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: 2 months 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-13T09:13:17.000Z (almost 2 years ago)
- Last Synced: 2025-03-19T19:46:22.794Z (3 months ago)
- Language: Rust
- Size: 109 KB
- Stars: 0
- Watchers: 2
- 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.