π‘ Inspired by ni
Choose the correct command prefix (npm, yarn, pnpm) based on the packageManager
configuration in your package.json
.
Why do we need to do this when we already have ni π€οΈ ?
Because ni runs on the Node environment, which means that when we switch between different versions of Node using tools like fnm and nvm, we always need to globally install ni, which is not elegant.
We hope to have a tool similar to ni, but it does not depend on the Node environment, so that we can better collaborate with fnm and nvm.
Our philosophy is somewhat different from ni. We are strict and require you to declare packageManager
in package.json
.
curl -fsSL https://raw.githubusercontent.com/sheinsight/ni/main/install.sh | bash
# Ready β
n i
# npm install
# yarn install
# pnpm install
# Ready β
n ci
# npm ci
# yarn install --frozen-lockfile (Yarn 1)
# pnpm install --frozen-lockfile
# 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
# 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
# Ready β
n dlx tsx
# npx vitest
# yarn dlx vitest
# pnpm dlx vitest
# Ready β
n u
# npm upgrade
# yarn upgrade (Yarn 1)
# pnpm update
# 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
# Ready β
n set-cache /root
# npm config set cache /root
# yarn config set cache-folder /root
# pnpm config set store-dir /root