littlelogger
Node.js utility for posting to http://littlelogs.co/
Example
var logger = var log = var message = 'Totally using a #nodejs/#npm module (#littlelogger) to post to #littlelogs!' log
API
logger(opts)
A logger constructor is returned via require('littlelogger')
and has a single argument opts
.
Where opts
is an Object with the following properties:
opts.email
: your secret email address as provided by littlelogsopts.transport
: a Nodemailer supported transport. Defaults to nodemailer-direct-transport.
Optionally you may pass a String as the opts
argument as a short-hand for opts.email
.
Useful should you wish to use the default nodemailer-direct-transport, or want to set your desired
transport later via logger.createTransport()
.
logger.createTransport(transport)
Accepts a Nodemailer supported transport as it's first argument transport
.
logger.send(message, cb(err, info))
The message
argument accepts a String of <= 250 character.
Your callback function cb
will be called once the message has been succesfully posted to littlelogs.
Or in the case of an Error your callback function cb
will be called, passing err
as the first
argument.
License
MIT