Coder Social home page Coder Social logo

jonschlinkert / parse-author Goto Github PK

View Code? Open in Web Editor NEW
24.0 6.0 2.0 25 KB

Parse a person, author, contributor or maintainer string into an object with name, email and url properties following NPM conventions. Useful for the `authors` property in package.json or for parsing an AUTHORS file into an array of person objects.

Home Page: https://github.com/jonschlinkert

License: MIT License

JavaScript 100.00%
person parse author regex somebody string

parse-author's Introduction

parse-author NPM version NPM monthly downloads NPM total downloads Linux Build Status

Parse a string into an object with name, email and url properties following npm conventions. Useful for the authors property in package.json or for parsing an AUTHORS file into an array of authors objects.

Install

Install with npm:

$ npm install --save parse-author

Usage

var parse = require('parse-author');

Supported formats

Works with a flexible range of formats, any of the properties can be used or missing:

Name
Name <email> (url)
Name <email>(url)
Name<email> (url)
Name<email>(url)
Name (url) <email>
Name (url)<email>
Name(url) <email>
Name(url)<email>
Name (url)
Name(url)
Name <email>
Name<email>
<email> (url)
<email>(url)
(url) <email>
(url)<email>
<email>
(url)

Examples

var author = parse('Jon Schlinkert <[email protected]> (https://github.com/jonschlinkert)');
console.log(author);
//=> {name: 'Jon Schlinkert', email: '[email protected]', url: 'https://github.com/jonschlinkert'}

console.log(parse('Jon Schlinkert (https://github.com/jonschlinkert)'));
//=> {name: 'Jon Schlinkert', url: 'https://github.com/jonschlinkert'}

console.log(parse('Jon Schlinkert <[email protected]>'));
//=> {name: 'Jon Schlinkert', email: '[email protected]'}

console.log(parse(''));
//=> {}

About

Related projects

Contributing

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

Contributors

Commits Contributor
14 slang800
12 jonschlinkert
1 MitMaro

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.4.3, on March 08, 2017.

parse-author's People

Contributors

jonschlinkert avatar mitmaro avatar notslang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

notslang

parse-author's Issues

License issue

Hi. It looks like this code was copied from https://github.com/npm/normalize-package-data/blob/master/lib/fixer.js#L359-L369

That in itself is fine, but only if the terms in the BSD-2-Clause license are followed.

Can you please comply with the conditions in the license? https://github.com/npm/normalize-package-data/blob/master/LICENSE

Specifically, include the copyright, list of conditions, and disclaimer in the LICENSE file and in the code, rather than a different copyright and license. Without permission from the copyright holders (ie, Meryn Stol and Contributors), sublicensing is not allowed.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.