Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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')\""
}
}
```