Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1009 Bytes

.verb.md

File metadata and controls

48 lines (39 loc) · 1009 Bytes

Usage

var parse = require('{%= name %}');

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(''));
//=> {}