Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manics/precommit-npm-run-scripts
A pre-commit hook to run NPM scripts from your package.json file
https://github.com/manics/precommit-npm-run-scripts
Last synced: 3 months ago
JSON representation
A pre-commit hook to run NPM scripts from your package.json file
- Host: GitHub
- URL: https://github.com/manics/precommit-npm-run-scripts
- Owner: manics
- License: mit
- Created: 2024-02-10T19:40:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-10T21:43:43.000Z (11 months ago)
- Last Synced: 2024-04-14T03:20:01.481Z (9 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pre-commit hook to run NPM scripts
A pre-commit hook to run NPM scripts from your `package.json` file.
**WARNING: This does not work with the [pre-commit.ci](https://pre-commit.ci/) service to as network access is only available during installation, it is blocked when running.**
It will:
- Run `npm install` to install your repository's dependencies.
- Run `npm run ` for each script in the `args` section of your `.pre-commit-config.yaml` file.## Example `.pre-commit-config.yaml`
```yaml
repos:
- repo: https://github.com/manics/precommit-npm-run-scripts
rev: main # Replace with a tag or commit hash
hooks:
- id: npm-run-scripts
args: [format]
```This will run `npm install` followed by `npm run format`.