Comparing version 0.21.12 to 0.22.0
@@ -85,3 +85,3 @@ import { Buffer } from 'node:buffer'; | ||
type Command = keyof typeof AGENTS.npm; | ||
declare const agents: ("npm" | "pnpm" | "yarn" | "yarn@berry" | "pnpm@6" | "bun")[]; | ||
declare const agents: Agent[]; | ||
declare const LOCKS: Record<string, Agent>; | ||
@@ -133,3 +133,3 @@ declare const INSTALL_PAGE: Record<Agent, string>; | ||
declare function remove<T>(arr: T[], v: T): T[]; | ||
declare function exclude<T>(arr: T[], v: T): T[]; | ||
declare function exclude<T>(arr: T[], ...v: T[]): T[]; | ||
declare function cmdExists(cmd: string): boolean; | ||
@@ -141,3 +141,5 @@ declare function getVoltaPrefix(): string; | ||
declare function writeFileSafe(path: string, data?: string | Buffer): Promise<boolean>; | ||
declare function limitText(text: string, maxWidth: number): string; | ||
declare function formatPackageWithUrl(pkg: string, url?: string, limits?: number): string; | ||
export { AGENTS, type Agent, CLI_TEMP_DIR, type Command, type DetectOptions, INSTALL_PAGE, LOCKS, type Runner, type RunnerContext, UnsupportedCommand, agents, cmdExists, detect, exclude, getCliCommand, getCommand, getConfig, getDefaultAgent, getGlobalAgent, getVoltaPrefix, parseNa, parseNi, parseNlx, parseNr, parseNu, parseNun, remove, run, runCli, writeFileSafe }; | ||
export { AGENTS, type Agent, CLI_TEMP_DIR, type Command, type DetectOptions, INSTALL_PAGE, LOCKS, type Runner, type RunnerContext, UnsupportedCommand, agents, cmdExists, detect, exclude, formatPackageWithUrl, getCliCommand, getCommand, getConfig, getDefaultAgent, getGlobalAgent, getVoltaPrefix, limitText, parseNa, parseNi, parseNlx, parseNr, parseNu, parseNun, remove, run, runCli, writeFileSafe }; |
{ | ||
"name": "@antfu/ni", | ||
"type": "module", | ||
"version": "0.21.12", | ||
"packageManager": "pnpm@8.11.0", | ||
"version": "0.22.0", | ||
"packageManager": "pnpm@9.5.0", | ||
"description": "Use the right package manager", | ||
@@ -42,4 +42,4 @@ "author": "Anthony Fu <anthonyfu117@hotmail.com>", | ||
"prepublishOnly": "npm run build", | ||
"dev": "esno src/commands/ni.ts", | ||
"nr": "esno src/commands/nr.ts", | ||
"dev": "tsx src/commands/ni.ts", | ||
"nr": "tsx src/commands/nr.ts", | ||
"build": "unbuild", | ||
@@ -52,25 +52,26 @@ "stub": "unbuild --stub", | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^2.1.1", | ||
"@antfu/eslint-config": "^2.22.0", | ||
"@jsdevtools/ez-spawn": "^3.0.4", | ||
"@posva/prompts": "^2.4.4", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/ini": "^1.3.33", | ||
"@types/node": "^20.10.0", | ||
"@types/which": "^3.0.3", | ||
"bumpp": "^9.2.0", | ||
"eslint": "^8.54.0", | ||
"esno": "^4.0.0", | ||
"execa": "^8.0.1", | ||
"@types/ini": "^4.1.1", | ||
"@types/node": "^20.14.10", | ||
"@types/which": "^3.0.4", | ||
"bumpp": "^9.4.1", | ||
"eslint": "^9.7.0", | ||
"fast-glob": "^3.3.2", | ||
"find-up": "^6.3.0", | ||
"fs-extra": "^11.1.1", | ||
"fs-extra": "^11.2.0", | ||
"fzf": "^0.5.2", | ||
"ini": "^4.1.1", | ||
"ini": "^4.1.3", | ||
"kleur": "^4.1.5", | ||
"rimraf": "^5.0.5", | ||
"rimraf": "^6.0.1", | ||
"taze": "^0.14.2", | ||
"terminal-link": "^3.0.0", | ||
"typescript": "^5.3.2", | ||
"tsx": "^4.16.2", | ||
"typescript": "^5.5.3", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^0.34.6", | ||
"vitest": "^2.0.2", | ||
"which": "^4.0.0" | ||
} | ||
} |
@@ -9,12 +9,10 @@ # ni | ||
<pre> | ||
npm i -g <b>@antfu/ni</b> | ||
</pre> | ||
``` | ||
npm i -g @antfu/ni | ||
``` | ||
<a href='https://docs.npmjs.com/cli/v6/commands/npm'>npm</a> · <a href='https://yarnpkg.com'>yarn</a> · <a href='https://pnpm.io/'>pnpm</a> · <a href='https://bun.sh/'>bun</a> | ||
<br> | ||
### `ni` - install | ||
@@ -56,3 +54,3 @@ | ||
# pnpm install --frozen-lockfile | ||
# bun install --no-save | ||
# bun install --frozen-lockfile | ||
``` | ||
@@ -71,2 +69,9 @@ | ||
```bash | ||
ni -i | ||
# interactively select the dependency to install | ||
# search for packages by name | ||
``` | ||
<br> | ||
@@ -148,2 +153,16 @@ | ||
```bash | ||
nun | ||
# interactively select | ||
# the dependency to remove | ||
``` | ||
```bash | ||
nun -m | ||
# interactive select, | ||
# but with multiple dependencies | ||
``` | ||
```bash | ||
nun -g silent | ||
@@ -167,3 +186,3 @@ | ||
# pnpm install --frozen-lockfile | ||
# bun install --no-save | ||
# bun install --frozen-lockfile | ||
``` | ||
@@ -235,4 +254,28 @@ | ||
```ps | ||
# for Windows | ||
# custom configuration file path in PowerShell accessible within the `$profile` path | ||
$Env:NI_CONFIG_FILE = 'C:\to\your\config\location' | ||
``` | ||
<br> | ||
### Integrations | ||
#### asdf | ||
You can also install ni via the [3rd-party asdf-plugin](https://github.com/CanRau/asdf-ni.git) maintained by [CanRau](https://github.com/CanRau) | ||
```bash | ||
# first add the plugin | ||
asdf plugin add ni https://github.com/CanRau/asdf-ni.git | ||
# then install the latest version | ||
asdf install ni latest | ||
# and make it globally available | ||
asdf global ni latest | ||
``` | ||
### How? | ||
@@ -239,0 +282,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
56
320
66
439668
23
13380
21