Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waynevanson/script-context
Run a script from package.json based on its context (ie. `postinstall:local` or `postinstall:dependency`)
https://github.com/waynevanson/script-context
Last synced: about 1 month ago
JSON representation
Run a script from package.json based on its context (ie. `postinstall:local` or `postinstall:dependency`)
- Host: GitHub
- URL: https://github.com/waynevanson/script-context
- Owner: waynevanson
- Created: 2022-12-28T04:36:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-13T09:13:17.000Z (over 1 year ago)
- Last Synced: 2024-11-30T16:42:01.907Z (about 1 month ago)
- Language: Rust
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `@waynvanson/script-context`
## Why
Where are some libraries out in the ecosystem that can do parts of what this tool can do,
but they either do an underwhelming job or are too tied to one aspect.## Use Cases
### `postinstall` Scripts
It will run either `postinstall:project` or `postinstall:package` based on the context,
using your package manager.This will work across any lifecycle script.
> TODO - Rename to `project` and `package`.
```json
// package.json{
"name": "your-package-name",
"version": "1.0.0",
"scripts": {
"postinstall": "script-context",
"postinstall:project": "echo 'launched project postinstall'",
"postinstall:package": "echo 'launched package postinstall'"
}
}
```### As library
Can be used in a node, neon/rust application directly.