parses the author field of a package.json
Note: only works on iojs and node v4+. To use with an older version of node,
install pkgauthor@1
.
$ npm install --save pkgauthor
var author = require('pkgauthor')
var input = {
name: 'Evan Lucas'
, email: 'evanlucas@me.com'
, url: 'http://curapps.com'
}
var out = author(input)
console.log(out)
// => {
// => name: 'Evan Lucas',
// => email: 'evanlucas@me.com'
// => url: 'http://curapps.com'
// => }
var author = require('pkgauthor')
var input = 'Evan Lucas <evanlucas@me.com> (http://curapps.com)'
var out = author(input)
console.log(out)
// => {
// => name: 'Evan Lucas',
// => email: 'evanlucas@me.com'
// => url: 'http://curapps.com'
// => }
$ npm test
$ npm run cover
MIT