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 <jon.schlinkert@sellside.com> (https://github.com/jonschlinkert)');
console.log(author);
//=> {name: 'Jon Schlinkert', email: 'jon.schlinkert@sellside.com', 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 <jon.schlinkert@sellside.com>'));
//=> {name: 'Jon Schlinkert', email: 'jon.schlinkert@sellside.com'}

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