npm-to-yarn
npm-to-yarn copied to clipboard
feat: add `npx` conversions
This PR adds a new type of conversions (for npx).
The command npx create-next-app is converted into:
yarn dlx create-next-app (yarn)
pnpm dlx create-next-app (pnpm)
bun x create-next-app (bun)
API Usage:
To apply this conversions the convert function is modified with a new parameter: executor : boolean with default value false.
function convert(str: string, to: 'npm' | 'yarn' | 'pnpm' | 'bun', executor: boolean = false)
Here's a code example.
convert("npx create-next-app", "yarn", true);
// yarn dlx create-next-app
convert("npx create-next-app", "bun", true);
// bun x create-next-app
Closes #48