pnpm add -g @brlt/nyarn global add @brlt/nnpm i -g @brlt/nBin Links: na, nb, nci, nd, ne, nh, ni, nl, no, np, nr, nt, nu, nun, nv
This package expands upon the original ni package created by Anthony Fu, adding several new commands.
My primary motivation has been laziness, leading to more shorthand aliases to functions often used in my workflows. There are also commands that have been renamed to resolve binary naming conflicts. For example, I had some trouble with Nx workspaces for monorepo projects, since nx was occupied. So nx was renamed to ne.
You may or may not find these useful.
Disclaimer: This is very much a work in progress. I haven't had time to add any tests for the updated commands yet, and I'm sure some of them are partially (maybe even completely) broken. Please create an Issue (or multiple issues) or a Discussion, with any kind of criticism or comments you have. I could really use your help!
ni assumes that you work with lockfiles (and you should). See the list of commands.
Before it runs, it will detect your yarn.lock / pnpm-lock.yaml / package-lock.json to know current package manager (or packageManager field in your packages.json), and runs the corresponding commands.
; ~/.nirc
; fallback when no lock found
defaultAgent=npm # default "prompt"
; for global installs
globalAgent=npm# ~/.bashrc
# custom configuration file path
export NI_CONFIG_FILE="$HOME/.config/ni/nirc"As the description states, this is an extended fork of the parent project, @antfu/ni, which means it comes with several new additions to it's list of features.
Note: in the examples below,
{npm,yarn,pnpm}indicates "either pnpm, yarn, or npm".{npm,pnpm}means "npm and pnpm", and so on.
nb
# {npm,yarn,pnpm} binnb -g
# npm bin --global
# yarn global bin
# pnpm -g binnd
# {npm,yarn,pnpm} diffnh
# {npm,yarn,pnpm} help
nh [topic]
# {npm,yarn,pnpm} help [topic]nh version
# {npm,yarn,pnpm} help versionnl next
# {npm,yarn,pnpm} link nextno
# {npm,yarn,pnpm} outdatedno [...options]
# {npm,yarn,pnpm} outdated [...options]no --long
# {npm,yarn,pnpm} outdated --longno --global
# {npm,pnpm} outdated --global
# yarn global outdatednp
# {npm,yarn,pnpm} publishnp [<tarball>|<dir>] [--tag <tag>] [--access <public|restricted>] [options]
# {npm,yarn,pnpm} publish [...arguments]np --registry=https://npm.pkg.github.com
# {npm,yarn,pnpm} publish --registry=https://npm.pkg.github.comExecute a package's test script, if it exists.
nt
# {npm,yarn,pnpm} testWithout any arguments, returns a list of versions for all local dependencies.
Provided arguments, modifies (or "bumps") a package's version number according to semver guidelines.
nv
# {npm,yarn,pnpm} versionnv [arguments]
# {npm,yarn,pnpm}nv patch
# {npm,yarn,pnpm} version patchI've made the decision to change a couple of names of existing commands, to help resolve naming conflicts I've encountered with other projects (like Nx by @nrwl).
Renamed to
neto eliminate conflict with Nx monorepo tool
ne jest
# npx jest
# {pnpm,yarn} dlx jestExisting Commands - inherited from @antfu/ni
ni [package] [options]
# {npm,yarn,pnpm} install [package] [options]ni axiosni @types/node -D
# npm i @types/node -D
# yarn add @types/node -D
# pnpm add -D @types/nodeni --frozen # or nci
# npm ci
# {pnpm,yarn} install --frozen-lockfileni -g iroiro
# npm i -g iroiro
# yarn global add iroiro
# pnpm add -g iroiro
# this uses default agent, regardless your current working directoryni -C packages/foo vite
nr -C playground devnci
# npm ci
# {pnpm,yarn} install --frozen-lockfileIf the corresponding node manager is not present, this command will install it globally.
nr [script] [options]
# {pnpm,yarn} <script> [options]
# npm run <script> [optionsnrSupports https://www.npmjs.com/package/npm-scripts-info convention
nr -nr dev --port=3000
# npm run dev -- --port=3000
# yarn run dev --port=3000
# pnpm run dev -- --port=3000na
# {npm,yarn,pnpm}nu
# pnpm update
# <npm|yarn> upgradenu -i # interactive update
# (currently not available for npm)
# yarn upgrade-interactive
# pnpm update -inun axios
# npm uninstall axios
# yarn remove axios
# pnpm remove axiosnun @types/node -D
# npm uninstall @types/node -D
# yarn remove @types/node -D
# pnpm remove -D @types/nodenun -g eslint
# npm uninstall -g eslint
# yarn global remove eslint
# pnpm remove -g eslintMIT © Nicholas Berlette and Anthony Fu