Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vordgi/yarn-plugin-hooker
Yarn plugin that adds support for Pre- and Post- hooks
https://github.com/vordgi/yarn-plugin-hooker
yarn yarn-berry yarn-plugin
Last synced: about 1 month ago
JSON representation
Yarn plugin that adds support for Pre- and Post- hooks
- Host: GitHub
- URL: https://github.com/vordgi/yarn-plugin-hooker
- Owner: vordgi
- License: mit
- Created: 2024-02-09T14:29:40.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-10T07:34:11.000Z (9 months ago)
- Last Synced: 2024-10-05T14:29:50.138Z (about 1 month ago)
- Topics: yarn, yarn-berry, yarn-plugin
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/yarn-plugin-hooker
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yarn-plugin-hooker
The plugin adds support for pre- and post-hooks for scripts in your package.json
## Installation
```bash
yarn dlx yarn-plugin-hooker
```## Usage
If you want to add a command that runs automatically before, for example, the `test` command, create a command with the `pre` prefix (`pretest`)
You can do the same for the post-execution action by adding a `post` prefix to the beginning (`posttest`)
```json
{
"name": "example",
"scripts": {
"pretest": "node -e \"console.log('pretest command')\"",
"test": "jest",
"posttest": "node -e \"console.log('posttest command')\""
}
}
```