🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

npm-to-yarn

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-to-yarn

Convert npm CLI commands to Yarn commands, and vice versa

2.2.1
Source
npm
Version published
Weekly downloads
127K
-22.62%
Maintainers
2
Weekly downloads
 
Created
Source

npm-to-yarn

npm License CI Coveralls

styled with prettier Dev Dependencies Donate

Summary

npm-to-yarn is designed to convert NPM CLI commands to their Yarn equivalents (and vice versa).

Why npm-to-yarn?

npm-to-yarn is super helpful in documentation, for example in generating code tabs.

📜 Docs

import convert from 'npm-to-yarn'

// or
// var convert = require('npm-to-yarn')

convert('npm install squirrelly', 'yarn')

// yarn add squirrelly

npm-to-yarn exposes a UMD build, so you can also install it with a CDN (it exposes global variable n2y)

API

/**
 * Converts between npm and yarn command
 */
export default function convert (str: string, to: 'npm' | 'yarn' | 'pnpm'): string

✔️ Tests

Tests can be run with npm test. Multiple tests check that parsing, rendering, and compiling return expected results, formatting follows guidelines, and code coverage is at the expected level.

Resources

To be added

Projects using npm-to-yarn

Contributors

Made with ❤ by @nebrelbug and all these wonderful contributors (emoji key):

This project follows the all-contributors specification. Contributions of any kind are welcome!

Keywords

string convert

FAQs

Package last updated on 16 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts