Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/n370/npm-publish-slack-webhook

https://www.npmjs.com/package/@n370/npm-publish-slack-webhook
https://github.com/n370/npm-publish-slack-webhook

npm slack webhooks

Last synced: 1 day ago
JSON representation

https://www.npmjs.com/package/@n370/npm-publish-slack-webhook

Awesome Lists containing this project

README

        

### npm publish Slack Webhook

#### How to use

```bash
npm install @n370/npm-publish-slack-webhook
```

Open your package's package.json and add a `postpublish` script to it;

```json
{
"scripts": {
"postpublish": "npm-publish-slack-webhook "
}
}
```
Every time you run `npm publish` and successfully publish a new package version you should get a message on slack like:

> `[email protected]` has been published!

#### Testing

##### With `npx`
```bash
npx @n370/npm-publish-slack-webhook
```

##### Against a local server

Start the test server included with the source files
```bash
node tests/server.js
```

Open another terminal tab, link the library using `npm link` and test it against the local server.

```bash
npm-publish-slack-webhook "http://localhost:1337/"
```