naugtur / npm-audit-resolver

Apache License 2.0
121 stars 28 forks source link

Support running npm-audit-resolver with npx #67

Open jesse-mm opened 1 year ago

jesse-mm commented 1 year ago

Problem Description

Currently a global installation is required (or local) to run the audit. This is not a issue but it would helpful to run the audit using npx, this way CI/CD instructions can be reduced by calling npx npm-audit-resolver, instead of running npm install -g npm-audit-resolver and afterwards resolve-audit.

Currently running npx npm-audit-resolver results in the following

npx npm-audit-resolver
npm ERR! could not determine executable to run

I think a fairly small change is required to make this happen by adding a entry in the package.json within the bin entry.

  "bin": {
    "check-audit": "check.js",
    "resolve-audit": "resolve.js",
    "npm-audit-resolver": "resolve.js"
  }

Let me know your thoughts about this.

joebowbeer commented 1 year ago

@jesse-mm There are two commands (check-audit and resolve-audit) and either can be invoked with npx.

See https://github.com/naugtur/npm-audit-resolver/issues/9#issuecomment-461136446

npx -p npm-audit-resolver check-audit
jesse-mm commented 1 year ago

Ah I didn't know about that! Is it worth adding it to the README ?

joebowbeer commented 1 year ago

I think it's worth adding to README.