# mkmsg

> Message injection

Latest version **1.2.6** (published 2016-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install mkmsg
pnpm add mkmsg
yarn add mkmsg
bun add mkmsg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.6 |
| Published | 2016-04-18 |
| First published | 2016-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | muji |
| Maintainers | muji |
| Keywords | markdown, commonmark, ast, transform, stream, inject |

## Links

- npm: https://www.npmjs.com/package/mkmsg
- Repository: https://github.com/mkdoc/mkmsg
- Homepage: https://github.com/mkdoc/mkmsg#readme
- Issues: https://github.com/mkdoc/mkmsg/issues
- npm.io page: https://npm.io/package/mkmsg

## Dependencies (2)

- [mkast](https://npm.io/package/mkast.md) ~1.2.2
- [through3](https://npm.io/package/through3.md) ~1.1.5

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.2.6 (latest) — 2016-04-18
- 1.2.5 — 2016-04-02
- 1.2.4 — 2016-03-26
- 1.2.3 — 2016-03-25
- 1.2.2 — 2016-03-25
- 1.2.1 — 2016-03-22
- 1.1.5 — 2016-03-21
- 1.1.4 — 2016-03-21
- 1.1.3 — 2016-03-19
- 1.1.2 — 2016-03-19

## README

# Message

[![Build Status](https://travis-ci.org/mkdoc/mkmsg.svg?v=3)](https://travis-ci.org/mkdoc/mkmsg)
[![npm version](http://img.shields.io/npm/v/mkmsg.svg?v=3)](https://npmjs.org/package/mkmsg)
[![Coverage Status](https://coveralls.io/repos/mkdoc/mkmsg/badge.svg?branch=master&service=github&v=3)](https://coveralls.io/github/mkdoc/mkmsg?branch=master)

> Append or prepend a message

By default appends a message to a stream, use the `message` option to change the message; to prepend set the `prepend` option.

When no message is given the default generator message is used.

## Install

```
npm i mkmsg --save
```

For the command line interface install [mkdoc][] globally (`npm i -g mkdoc`).

---

- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [Help](#help)
- [API](#api)
  - [msg](#msg)
    - [Options](#options)
- [License](#license)

---

## Usage

Create the stream and write a [commonmark][] document:

```javascript
var msg = require('mkmsg')
  , ast = require('mkast');
ast.src('This is a markdown paragraph.')
  .pipe(msg())
  .pipe(ast.stringify({indent: 2}))
  .pipe(process.stdout);
```

## Example

Append the default generator message:

```shell
mkcat README.md | mkmsg | mkout
```

Append a custom message:

```shell
mkcat README.md | mkmsg -m "Commit: $(git rev-parse HEAD)" | mkout
```

Prepend a custom message:

```shell
mkcat README.md | mkmsg -p -m "Commit: $(git rev-parse HEAD)" | mkout
```

## Help

```
Usage: mkmsg [options]

  Message injection.

Options
  -m, --message=[MSG]     Custom message, parsed as markdown
  -p, --prepend           Prepend message to the stream
  -h, --help              Display help and exit
  --version               Print the version and exit

mkmsg@1.2.5
```

## API

### msg

```javascript
msg([opts][, cb])
```

Append or prepend a message string.

The message string is parsed as markdown and written to the end of the
document unless `prepend` is given.

The document node itself is omitted; it's content nodes are written to
the stream.

Returns an output stream.

* `opts` Object processing options.
* `cb` Function callback function.

#### Options

* `input` Readable input stream.
* `output` Writable output stream.
* `message` String markdown message.
* `prepend` Boolean prepend message to the stream.

## License

MIT

---

Created by [mkdoc](https://github.com/mkdoc/mkdoc) on April 18, 2016

[mkdoc]: https://github.com/mkdoc/mkdoc
[mkparse]: https://github.com/mkdoc/mkparse
[commonmark]: http://commonmark.org
[jshint]: http://jshint.com
[jscs]: http://jscs.info

---
_Source: https://npm.io/package/mkmsg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
