@armano/npm-to-yarn
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

npm-to-yarn

npm CI NPM

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 commonjs build

API

/**
 * Converts yarn to npm command
 */
export function convertToNpm(str: string): string;

/**
 * Converts npm to yarn command
 */
export function convertToYarn(str: string): string;

/**
 * Converts between npm and yarn command
 */
export default function convert(str: string, to: 'npm' | 'yarn'): 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!

Package Sidebar

Install

npm i @armano/npm-to-yarn

Weekly Downloads

5

Version

1.1.3

License

MIT

Unpacked Size

23.9 kB

Total Files

15

Last publish

Collaborators

  • armano