Core translation engine - Translate package manager commands between npm, yarn, pnpm, bun, and deno.
npm install sxpmimport { translateCommand } from 'sxpm'
const result = translateCommand({
command: 'add',
args: ['react', '--save-dev'],
from: 'npm',
to: 'pnpm'
})
console.log(result)
// { command: 'add', args: ['react', '-D'], pm: 'pnpm' }import { translateArgs } from 'sxpm'
const result = translateArgs({
args: ['--save-dev', 'react'],
from: 'npm',
to: 'pnpm'
})
console.log(result)
// ['-D', 'react']Translates a command from one package manager to another.
Translates arguments from one package manager to another.
Cleans a flag for translation between package managers.
Gets the configuration for a specific package manager.
Checks if a package manager is supported.
Returns list of all supported package managers.
- npm
- yarn (classic)
- yarn@berry (v2+)
- pnpm
- bun
- deno (v2.0+)
MIT