@pnpm/exec
Advanced tools
Comparing version 1.0.2 to 1.1.0
export default function (args: string[], opts?: { | ||
cwd?: string; | ||
env?: object; | ||
}): Promise<void>; |
@@ -18,2 +18,3 @@ "use strict"; | ||
const cwd = opts.cwd || process.cwd(); | ||
const env = opts.env || process.env; | ||
try { | ||
@@ -30,2 +31,3 @@ yield commandExists('pnpm'); | ||
cwd, | ||
env, | ||
}); | ||
@@ -40,2 +42,3 @@ }); | ||
cwd: opts.cwd, | ||
env: opts.env, | ||
stdio: 'inherit', | ||
@@ -42,0 +45,0 @@ }); |
declare const _default: () => Promise<void>; | ||
export default _default; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "@pnpm/exec", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Executes pnpm. If pnpm is not installed, installs it first", | ||
@@ -13,2 +13,3 @@ "main": "lib/index.js", | ||
"lint": "tslint -c tslint.json --project .", | ||
"pretest": "preview", | ||
"test": "mos test && npm run lint && rimraf test/fixture/node_modules && ts-node test", | ||
@@ -43,2 +44,3 @@ "prepublishOnly": "tsc" | ||
"mos-plugin-readme": "^1.0.4", | ||
"package-preview": "^0.2.3", | ||
"rimraf": "^2.6.2", | ||
@@ -45,0 +47,0 @@ "tape": "^4.8.0", |
@@ -18,3 +18,3 @@ # @pnpm/exec | ||
```ts | ||
const pnpm = require('./lib').default | ||
const pnpm = require('@pnpm/exec').default | ||
@@ -26,4 +26,15 @@ pnpm(['install']) | ||
## API | ||
### `pnpmExec(args, [opts])` | ||
Executes pnpm. If pnpm is not available, installs it first. | ||
- `args` - _string\[]_ - list of string arguments. | ||
- `[opts]` - _object_ | ||
- `cwd` - _string_ - current working directory of the child process. | ||
- `env` - _object_ - environment key-value pairs. By default the value of the current `process.env`. | ||
## License | ||
[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io/) |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
9321
92
39
9
2