Socket
Socket
Sign inDemoInstall

@antfu/ni

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antfu/ni - npm Package Compare versions

Comparing version 0.22.1 to 0.22.2

dist/shared/ni.218085d2.mjs

103

dist/index.d.ts

@@ -0,89 +1,6 @@

import { Agent as Agent$1, Command } from 'package-manager-detector/agents';
export { AGENTS, Agent, COMMANDS, Command, INSTALL_PAGE, LOCKS } from 'package-manager-detector/agents';
import { Agent } from 'package-manager-detector';
import { Buffer } from 'node:buffer';
declare const AGENTS: {
npm: {
agent: string;
run: (args: string[]) => string;
install: string;
frozen: string;
global: string;
add: string;
upgrade: string;
'upgrade-interactive': null;
execute: string;
uninstall: string;
global_uninstall: string;
};
yarn: {
agent: string;
run: string;
install: string;
frozen: string;
global: string;
add: string;
upgrade: string;
'upgrade-interactive': string;
execute: string;
uninstall: string;
global_uninstall: string;
};
'yarn@berry': {
frozen: string;
upgrade: string;
'upgrade-interactive': string;
execute: string;
global: string;
global_uninstall: string;
agent: string;
run: string;
install: string;
add: string;
uninstall: string;
};
pnpm: {
agent: string;
run: string;
install: string;
frozen: string;
global: string;
add: string;
upgrade: string;
'upgrade-interactive': string;
execute: string;
uninstall: string;
global_uninstall: string;
};
'pnpm@6': {
run: (args: string[]) => string;
agent: string;
install: string;
frozen: string;
global: string;
add: string;
upgrade: string;
'upgrade-interactive': string;
execute: string;
uninstall: string;
global_uninstall: string;
};
bun: {
agent: string;
run: string;
install: string;
frozen: string;
global: string;
add: string;
upgrade: string;
'upgrade-interactive': string;
execute: string;
uninstall: string;
global_uninstall: string;
};
};
type Agent = keyof typeof AGENTS;
type Command = keyof typeof AGENTS.npm;
declare const agents: Agent[];
declare const LOCKS: Record<string, Agent>;
declare const INSTALL_PAGE: Record<Agent, string>;
interface Config {

@@ -94,4 +11,4 @@ defaultAgent: Agent | 'prompt';

declare function getConfig(): Promise<Config>;
declare function getDefaultAgent(programmatic?: boolean): Promise<"npm" | "pnpm" | "yarn" | "yarn@berry" | "pnpm@6" | "bun" | "prompt">;
declare function getGlobalAgent(): Promise<"npm" | "pnpm" | "yarn" | "yarn@berry" | "pnpm@6" | "bun">;
declare function getDefaultAgent(programmatic?: boolean): Promise<"npm" | "yarn" | "yarn@berry" | "pnpm" | "pnpm@6" | "bun" | "prompt">;
declare function getGlobalAgent(): Promise<"npm" | "yarn" | "yarn@berry" | "pnpm" | "pnpm@6" | "bun">;

@@ -103,3 +20,3 @@ interface DetectOptions {

}
declare function detect({ autoInstall, programmatic, cwd }?: DetectOptions): Promise<"npm" | "pnpm" | "yarn" | "yarn@berry" | "pnpm@6" | "bun" | null>;
declare function detect({ autoInstall, programmatic, cwd }?: DetectOptions): Promise<"npm" | "yarn" | "yarn@berry" | "pnpm" | "pnpm@6" | "bun" | null>;

@@ -111,3 +28,3 @@ interface RunnerContext {

}
type Runner = (agent: Agent, args: string[], ctx?: RunnerContext) => Promise<string | undefined> | string | undefined;
type Runner = (agent: Agent$1, args: string[], ctx?: RunnerContext) => Promise<string | undefined> | string | undefined;
declare function runCli(fn: Runner, options?: DetectOptions & {

@@ -121,7 +38,7 @@ args?: string[];

constructor({ agent, command }: {
agent: Agent;
agent: Agent$1;
command: Command;
});
}
declare function getCommand(agent: Agent, command: Command, args?: string[]): string;
declare function getCommand(agent: Agent$1, command: Command, args?: string[]): string;
declare const parseNi: Runner;

@@ -146,2 +63,2 @@ declare const parseNr: Runner;

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 };
export { CLI_TEMP_DIR, type DetectOptions, type Runner, type RunnerContext, UnsupportedCommand, 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.22.1",
"version": "0.22.2",
"packageManager": "pnpm@9.7.0",

@@ -50,20 +50,22 @@ "description": "Use the right package manager",

},
"dependencies": {
"package-manager-detector": "^0.1.1",
"tinyexec": "^0.1.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.25.0",
"@jsdevtools/ez-spawn": "^3.0.4",
"@antfu/eslint-config": "^2.25.1",
"@posva/prompts": "^2.4.4",
"@types/fs-extra": "^11.0.4",
"@types/ini": "^4.1.1",
"@types/node": "^22.1.0",
"@types/node": "^22.3.0",
"@types/which": "^3.0.4",
"bumpp": "^9.4.2",
"eslint": "^9.8.0",
"fast-glob": "^3.3.2",
"find-up": "^6.3.0",
"bumpp": "^9.5.1",
"eslint": "^9.9.0",
"fs-extra": "^11.2.0",
"fzf": "^0.5.2",
"ini": "^4.1.3",
"kleur": "^4.1.5",
"taze": "^0.16.3",
"picocolors": "^1.0.1",
"taze": "^0.16.5",
"terminal-link": "^3.0.0",
"tinyglobby": "^0.2.2",
"tsx": "^4.17.0",

@@ -70,0 +72,0 @@ "typescript": "^5.5.4",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc