Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@antfu/ni is a command-line tool that provides a unified interface for package managers like npm, yarn, and pnpm. It simplifies the process of managing dependencies by automatically detecting the package manager used in a project and running the appropriate commands.
Install Dependencies
The `ni` command installs dependencies in the current project. It automatically detects the package manager used (npm, yarn, or pnpm) and runs the corresponding install command.
ni
Add a Dependency
The `ni <package>` command adds a new dependency to the project. It detects the package manager and runs the appropriate command to add the specified package.
ni axios
Remove a Dependency
The `nr <package>` command removes a dependency from the project. It detects the package manager and runs the appropriate command to remove the specified package.
nr axios
Upgrade Dependencies
The `nu` command upgrades all dependencies in the project. It detects the package manager and runs the appropriate command to upgrade the dependencies.
nu
Run Scripts
The `ni run <script>` command runs a script defined in the project's package.json file. It detects the package manager and runs the appropriate command to execute the script.
ni run build
npm is the default package manager for Node.js. It provides a wide range of commands for managing dependencies, running scripts, and more. Unlike @antfu/ni, npm does not automatically detect other package managers.
Yarn is a fast, reliable, and secure dependency management tool. It offers similar functionalities to npm but with a focus on speed and reliability. Yarn does not provide a unified interface for other package managers like @antfu/ni.
pnpm is a fast, disk space-efficient package manager. It uses a unique symlink-based approach to manage dependencies. Like npm and yarn, pnpm does not offer a unified interface for other package managers.
npm i
in a yarn project, again? F**k!
ni - use the right package manager
npm i -g @antfu/ni ni
ni
- installni
# 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
- runnr
# npm run start
# yarn run start
# pnpm run start
nr dev --port=3000
# npm run dev -- --port=3000
# yarn run dev --port=3000
# pnpm run dev -- --port=3000
nci
- clean installnci
# 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.
; ~/.nirc
; default agent will be used for global installs
; and the fallback when no lock found.
defaultAgent=npm
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.
FAQs
Use the right package manager
The npm package @antfu/ni receives a total of 248,375 weekly downloads. As such, @antfu/ni popularity was classified as popular.
We found that @antfu/ni demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.