🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

stringify-authors

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringify-authors

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.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
2
Created
Source

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)
  • author-regex: Regular expression for parsing an author string into an object following npm conventions. | homepage
  • parse-author: Parse a string into an object with name, email and url properties following npm conventions.… more | homepage
  • parse-authors: Parse a string into an array of objects with name, email and url properties following… more | homepage
  • stringify-author: Stringify an authors object to name <email> (url). | homepage

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.

Keywords

author

FAQs

Package last updated on 16 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts