JSPM

  • Created
  • Published
  • Downloads 683603
  • Score
    100M100P100Q189774F
  • License MIT

Use the right package manager

Package Exports

  • @antfu/ni

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@antfu/ni) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ni

npm i in a yarn project, again? F**k!

ni - use the right package manager


npm i -g @antfu/ni

ni

npm · yarn · pnpm


ni - install

ni

# npm install
# yarn install
# pnpm install
ni axios

# npm i axios
# yarn add axios
# pnpm i axios
ni @types/node -D

# npm i @types/node -D
# yarn add @types/node -D
# pnpm i @types/node -D
ni --frozen

# npm ci
# yarn install --frozen-lockfile
# pnpm install --frozen-lockfile
ni -g iroiro

# npm i -g iroiro
# yarn global add iroiro
# pnpm i -g iroiro
# this uses default agent, regardless CWD

nr - run

nr dev --port=3000

# npm run dev -- --port=3000
# yarn run dev --port=3000
# pnpm run dev -- --port=3000
nr

# interactively select the script to run

nu - upgrade

nu

# npm upgrade
# yarn upgrade
# pnpm upgrade
nu -i

# (not available for npm)
# yarn upgrade-interactive
# pnpm upgrade -i

nci - clean install

nci

# npm ci
# yarn install --frozen-lockfile
# pnpm install --frozen-lockfile

if the corresponding node manager is not present, this command will install it globally along the way.


Config

; ~/.nirc

; fallback when no lock found
defaultAgent=npm # default "prompt"

; for global installs
globalAgent=npm

How?

ni assumes that you work with lockfiles (and you should)

Before it runs, it will detect your yarn.lock / pnpm-lock.yaml / package-lock.json to know current package manager, and runs the corresponding commands.