Generator
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
).
Usage
Create the stream and write a commonmark document:
var gen = require('mkmsg')
, ast = require('mkast');
ast.src('This is a markdown paragraph.')
.pipe(gen())
.pipe(ast.stringify({indent: 2}))
.pipe(process.stdout);
API
gen
gen([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 generator message.prepend
Boolean prepend message to the stream.
License
MIT
Generated by mkdoc.