Skip to content

Commit

Permalink
🎉 feat: add nv for npm view
Browse files Browse the repository at this point in the history
  • Loading branch information
fyzhu committed Aug 2, 2022
1 parent 9d1ce61 commit 2a9c6a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/nv.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
'use strict'
import '../dist/nv.mjs'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"nr": "bin/nr.mjs",
"nu": "bin/nu.mjs",
"nx": "bin/nx.mjs",
"nv": "bin/nv.mjs",
"nw": "bin/nw.mjs",
"na": "bin/na.mjs",
"nci": "bin/nci.mjs",
Expand Down
4 changes: 4 additions & 0 deletions src/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const yarn = {
'run': 'yarn run {0}',
'install': 'yarn install {0}',
'why': 'yarn why {0}',
'view': 'yarn view {0}',
'frozen': 'yarn install --frozen-lockfile',
'global': 'yarn global add {0}',
'add': 'yarn add {0}',
Expand All @@ -23,6 +24,7 @@ const pnpm = {
'run': 'pnpm run {0}',
'install': 'pnpm i {0}',
'why': 'pnpm why {0}',
'view': 'pnpm view {0}',
'frozen': 'pnpm i --frozen-lockfile',
'global': 'pnpm add -g {0}',
'add': 'pnpm add {0}',
Expand All @@ -37,6 +39,7 @@ const bun = {
'run': 'bun run {0}',
'install': 'bun install {0}',
'why': 'bun why {0}',
'view': 'bun view {0}',
'frozen': 'bun install --no-save',
'global': 'bun add -g {0}',
'add': 'bun add {0}',
Expand All @@ -53,6 +56,7 @@ export const AGENTS = {
'run': npmRun('npm'),
'install': 'npm i {0}',
'why': 'npm why {0}',
'view': 'npm view {0}',
'frozen': 'npm ci',
'global': 'npm i -g {0}',
'add': 'npm i {0}',
Expand Down
4 changes: 4 additions & 0 deletions src/commands/nv.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { parseNv } from '../parse'
import { runCli } from '../runner'

runCli(parseNv)
3 changes: 3 additions & 0 deletions src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,6 @@ export const parseNa = <Runner>((agent, args) => {
export const parseNw = <Runner>((agent, args) => {
return getCommand(agent, 'why', args)
})
export const parseNv = <Runner>((agent, args) => {
return getCommand(agent, 'view', args)
})

0 comments on commit 2a9c6a8

Please sign in to comment.