hook.add( 'output', 'prepend-subsystem-name', function( output ){
var subsystem = 'heroku-formatting-12345',
prefix = '['+ subsystem + '] ';
return prefix + output;
});
var output = hook.run( 'output', 'hello world!' );
console.log( output );
hook.add( 'stdin', 'handle-string', function( input ){
if( typeof input !== 'string' ) return;
hook.end();
});
hook.add( 'stdin', 'handle-number', function( input ){
if( typeof input !== 'number' ) return;
hook.end();
});
process.on( 'data', function( data ){
hook.run( 'stdin', data );
});
hook.add( 'message-to-send', 'markdown-to-html', function( message ){
var pre_markdown_expanded_message = hook.run( 'pre-markdown-to-html', message );
return markdown_expanded_message;
});
hook.add( 'pre-markdown-to-html', 'convert-url-to-markdown-link', function( message ){
return url_to_markdown_message;
});
app.send( hook.run( 'message-to-send', {
to: 'timmy',
from: 'tommy',
content: 'you should check *this* out https://youtu.be/dQw4w9WgXcQ'
}));