Skip to content

evanlucas/pkgauthor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pkgauthor

Build Status Coverage Status

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.

Install

$ npm install --save pkgauthor

Usage

pkgauthor(Object)

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'
// => }

pkgauthor(String)

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'
// => }

Tests

$ npm test

Coverage

$ npm run cover

License

MIT

About

parses the author field of a package.json

Resources

Stars

Watchers

Forks

Packages

No packages published