Last active
May 25, 2022 00:35
-
-
Save anshumanb/94cea832ee00e45b0f21a691c83592cb to your computer and use it in GitHub Desktop.
Call NPM from Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { spawnSync } from "child_process"; | |
spawnSync("npm", ["--version"], { | |
encoding: "utf-8", | |
shell: true, | |
stdio: [process.stdin, process.stdout, process.stderr], | |
cwd: process.cwd(), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment