Szczepan Hołyszewski
Szczepan Hołyszewski

Reputation: 3167

How to properly execute an executable supplied by a package that I wrote (or cloned), without also creating a package that uses it?

I created a package named env-subset that supplies an executable via the bin key in package.json:

  "bin": {
    "env-subset": "./index.js"
  },

Is there an official blessed way to make this executable actually materialize somewhere so that I can execute it, without doing any of the following:

Upvotes: 1

Views: 161

Answers (1)

Zoltan Kochan
Zoltan Kochan

Reputation: 7646

Install your package as a dependency of itself:

pnpm add -D env-subset@link:

Now you can run:

pnpm env-subset

Or:

./node_modules/.bin/env-subset

Upvotes: 1

Related Questions