Converts an author object or array of author objects into an array of strings. Useful for adding authors, maintainers or contributors to documentation, package.json or a readme.
Install with npm
$ npm i stringify-authors --save
var authors = require('stringify-authors');
Given an array of author objects:
var authors = [{
name: 'Jon Schlinkert',
email: 'jon.schlinkert@sellside.com',
url: 'https://github.com/jonschlinkert'
}, {
name: 'Brian Woodward',
url: 'https://github.com/doowb',
email: 'brian.woodward@sellside.com'
}]
// default separator is ', '
stringify(authors, {sep: '\n'});
results in:
Jon Schlinkert <jon.schlinkert@sellside.com> (https://github.com/jonschlinkert)
Brian Woodward <brian.woodward@sellside.com> (https://github.com/doowb)
stringify(authors, {filter: 'name'});
//=> Jon Schlinkert, Brian Woodward
stringify(authors, {filter: '{name,url}', sep: '\n'});
// Jon Schlinkert (https://github.com/jonschlinkert)
// Brian Woodward (https://github.com/doowb)
author string into an object following npm conventions. | homepagename, email and url properties following npm conventions.… more | homepagename, email and url properties following… more | homepagename <email> (url). | homepageInstall dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on November 16, 2015.