Helix is a non-ambitious wrappers for npm
commands! Run your favorite npm
commands directly from your Deno app!
The only permission required for this Module is --allow-run
, we need this permission to invoke npm
.
Simply import mod.ts
and call the wrapper functions:
isNpmInstalled
: Checks if NPM is installed and available, returns a boolean.restoreNpmPackages
: Attempts to runnpm install
within a directory, returns a boolean.runNpmScript
: Attempts to runnpm run
for a script and within a directory, returns a boolean.runNpmCommand
: Attempts to runnpm <command>
within a directory, returns a boolean.runGenericNpmCommand
: Attempts to run anpm <command>
created as a Object inheriting theNpmCommand
class.
The following snippet runs the following, using this Module:
- Check if NPM is installed
- IF True then
- Attempts to restore dependencies (
npm install
) - Checks for fundraisers (
npm fund
) - Attempts to run a build script (
npm run build
)
if (await isNpmInstalled()) {
await restoreNpmPackages('./subject/');
await runNpmCommand(['fund'], './subject/');
await runNpmScript('build', './subject/')
}
// Run with deno run --allow-run myfile.ts
- Windows Wrappers
- Module (tested on Win10 2004)
- Automated Tests
- Linux Wrappers
- Module (tested on Ubuntu 20.04 running within WSL2)
- Automated Tests
- CLI
- Mac Tests
- Module
- Automated Tests
- Improve Logging
- Allow extensibility