Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rodolphocastro/helix
Helix is a simple wrapper for NPM commands written in Deno
https://github.com/rodolphocastro/helix
deno deno-module npm spa
Last synced: 5 days ago
JSON representation
Helix is a simple wrapper for NPM commands written in Deno
- Host: GitHub
- URL: https://github.com/rodolphocastro/helix
- Owner: rodolphocastro
- Created: 2020-06-28T16:54:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-05T01:55:18.000Z (over 4 years ago)
- Last Synced: 2025-01-07T04:17:53.584Z (about 1 month ago)
- Topics: deno, deno-module, npm, spa
- Language: TypeScript
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🐚 Helix
**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`.
---
## 🚦 Build Status
**Master**(latest): ![Deno - Cache](https://github.com/rodolphocastro/helix/workflows/Deno%20-%20Cache/badge.svg)
## ⚡ Quickstart
Simply import `mod.ts` and call the *wrapper* functions:
+ `isNpmInstalled`: Checks if NPM is installed and available, returns a boolean.
+ `restoreNpmPackages`: Attempts to run `npm install` within a *directory*, returns a boolean.
+ `runNpmScript`: Attempts to run `npm run` for a *script* and within a *directory*, returns a boolean.
+ `runNpmCommand`: Attempts to run `npm ` within a *directory*, returns a boolean.
+ `runGenericNpmCommand`: Attempts to run a `npm ` created as a Object *inheriting* the `NpmCommand` class.### 📌 Sample
The following snippet runs the following, using this Module:
1. Check if NPM is installed
1. IF True then
2. Attempts to restore dependencies (`npm install`)
3. Checks for fundraisers (`npm fund`)
4. Attempts to run a build script (`npm run build`)```typescript
if (await isNpmInstalled()) {
await restoreNpmPackages('./subject/');
await runNpmCommand(['fund'], './subject/');
await runNpmScript('build', './subject/')
}// Run with deno run --allow-run myfile.ts
```## 🛣 Roadmap
+ [X] Windows Wrappers
+ [X] Module (*tested on Win10 2004*)
+ [ ] Automated Tests
+ [X] Linux Wrappers
+ [X] Module (*tested on Ubuntu 20.04 running within WSL2*)
+ [ ] Automated Tests
+ [ ] CLI
+ [ ] Mac Tests
+ [ ] Module
+ [ ] Automated Tests
+ [ ] Improve Logging
+ [X] Allow extensibility