https://github.com/akgondber/post-command-hook-add-gitignore-plugin
Automatically adds .gitignore file plugin for post-command-hook
https://github.com/akgondber/post-command-hook-add-gitignore-plugin
Last synced: 3 months ago
JSON representation
Automatically adds .gitignore file plugin for post-command-hook
- Host: GitHub
- URL: https://github.com/akgondber/post-command-hook-add-gitignore-plugin
- Owner: akgondber
- Created: 2023-01-06T01:48:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:49:35.000Z (over 2 years ago)
- Last Synced: 2025-02-14T22:07:52.843Z (4 months ago)
- Language: JavaScript
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# post-command-hook-add-gitignore-plugin [![NPM version][npm-image]][npm-url]
> Add Gitignore plugin for post-command-hook.
Add Gitignore plugin for [post-command-hook](https://www.npmjs.com/package/post-command-hook) automatically creates .gitignore file (with predefined items as a content by default) after some command have been executed.
## Installation
```sh
$ npm install --save-dev post-command-hook post-command-hook-add-gitignore-plugin
```## Usage
```js
const PostCommandHook = require("post-command-hook");
const AddGitignorePlugin = require("post-command-hook-add-gitignore-plugin");const postCommandHook = new PostCommandHook({
command: "echo",
args: ["Setup"],
});
postCommandHook.use(new AddGitignorePlugin());(async () => {
await postCommandHook.run();
})();
```## API
### new AddGitignorePlugin()
Constructs an instance of AddGitignorePlugin class.
### .addItem(item)
Adds specified item to include it to the .gitignore file.
#### item
Type: `string`
### .addItems(items)
Adds specified items to the patterns so they are going to be included in the generated .gitignore file.
#### items
Type: `array`
Array of strings to be appended to the patterns.
### .setItems(items)
Overrides patterns array with specified items.
#### items
Type: `array`
Array of strings to override patterns array with.
## License
MIT © [Rushan Alyautdinov](https://github.com/akgondber)
[npm-image]: https://img.shields.io/npm/v/post-command-hook-add-gitignore-plugin.svg?style=flat
[npm-url]: https://npmjs.org/package/post-command-hook-add-gitignore-plugin