stringify-authors
Stringify an array or object of authors. Useful for adding authors, maintainers or contribuors to documentation or a readme.
Last updated 6 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stringify-authors 
SYNC missed versions from official npm registry.

stringify-authors NPM version Build Status

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

Install with npm

$ npm i stringify-authors --save

Usage

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)

Filter with glob patterns

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)

Related

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on November 16, 2015.

Current Tags

  • 0.2.0                                ...           latest (5 years ago)

2 Versions

  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |