Pipe things into Slack or Mattermost.
const slackstream = ;let stream = ;stream;
slackstream(webhookURL[, options ])
Returns a new writable stream that will make POST requests to the specified
webhookURL. The optional
options argument accepts the following options:
defaults: (Object) A template object that will be used for each request. The defaults will be overwritten by anything that you pass to
wait: (Integer|Boolean) Do not send requests immediately on
stream.write(), instead input will be buffered until no writes have occurred for the specified number of milliseconds (defaults to 200ms if passed
trueinstead of an integer). Input will be sent immediately once it reaches Mattermost's limit of 4000 characters.
Note: This option will disable object mode. The stream will emit an error if you try to write an object. Buffers and strings work as expected and will be joined together when the input is eventually sent.
payload to the
webhookURL specified when the stream was created.
payload can be an object, in which case it will be used as the payload, or
anything else, in which case it will be stringified and used as the payload's
payload.text must be set and will always be stringified. All other properties
of payload will be used as they are.
Default values for the payload can be specified when the stream is first created.
const slackstream = ;const URL = '';let stream = ;stream;stream;let cookieMonster =;cookieMonster;cookieMonster
npm install -g slackstreamecho "Hello world" | slackstream http://mm.example.com/hooks/abcd1234 \--defaults.username octocat \--defaults.channel town-square