somebody
v3.0.0
Published
Parse/stringify contact info like `Sindre Sorhus <[email protected]> (sindresorhus.com)`
Downloads
39
Maintainers
Readme
somebody
Parse/stringify contact info like
Sindre Sorhus <[email protected]> (sindresorhus.com)
Install
$ npm install somebody
Usage
import {parse, stringify} from 'somebody';
const author = 'Sindre Sorhus <[email protected]> (sindresorhus.com)';
const parsed = parse(author);
//=> {name: 'Sindre Sorhus', email: '[email protected]', url: 'https://sindresorhus.com'}
stringify(parsed) === author;
//=> true
Email and URL are optional.