n
Why
ni is nice , but ni is based on Node.
it is difficult to collaborate well with node version management tools like fnm and nvm.
Therefore, we need an executable file that does not depend on any environment.
Installation
Using a script (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/sheinsight/ni/main/install.sh | bash
Use case
install
# Ready โ
n i
# npm install
# yarn install
# pnpm install
# Ready โ
n ci
# npm ci
# yarn install --frozen-lockfile (Yarn 1)
# pnpm install --frozen-lockfile
add
# Ready โ
n add react
# npm add react
# yarn add react
# pnpm add react
# Ready โ
n add react -D
# npm add --save-dev react
# yarn add --save-dev react
# pnpm add --save-dev react
# Ready โ
n add react -S
# npm add --save react
# yarn add --save react
# pnpm add --save react
# Ready โ
n add react -O
# npm add --save-optional react
# yarn add --save-optional react
# pnpm add --save-optional react
# Ready โ
n add -g eslint
# npm add --global eslint
# yarn global add eslint (Yarn 1)
# pnpm add --global eslint
run
# Ready โ
n r dev
# npm run dev
# yarn run dev
# pnpm run dev
# Ready โ
n r dev --port=3000
# npm run dev -- --port=3000
# yarn run dev --port=3000
# pnpm run dev --port=3000
# Ready โ
n r
# interactively select the script to run
# supports https://www.npmjs.com/package/npm-scripts-info convention
npx
# Ready โ
n x tsx
# npx vitest
# yarn dlx vitest
# pnpm dlx vitest
upgrade
# Ready โ
n u
# npm upgrade
# yarn upgrade (Yarn 1)
# pnpm update
uninstall
# Ready โ
n un
# npm uninstall webpack
# yarn remove webpack
# pnpm remove webpack
# Ready โ
n un -g silent
# npm uninstall -g silent
# yarn global remove silent
# pnpm remove -g silent
How
Unlike ni, n requires you to configure packageManager in package.json.
Because we hope everything is clear.