littlelogger

1.0.1 • Public • Published

littlelogger

Build Status js-standard-style

Node.js utility for posting to http://littlelogs.co/

Example

var logger = require('littlelogger')
 
var log = logger('your-email-secret')
var message = 'Totally using a #nodejs/#npm module (#littlelogger) to post to #littlelogs!'
 
log.send(message, function (err, info) {
  if (err) {
    return console.log(err)
  }
  console.log('sent!')
})

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:

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

Readme

Keywords

Package Sidebar

Install

npm i littlelogger

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • joshgillies