Skip to content
Parse the name of contact info like `name <mail> (url)`
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.travis.yml
LICENSES.md
README.md
bower.json
package.json
parse-author-name-cjs.js
parse-author-name.js
test.js

README.md

parse-author-name

NPM version Bower version Build Status Coverage Status devDependency Status

Parse the name of contact info like name <mail> (url)

let info = 'Shinnosuke Watanabe <snnskwtnb@gmail.com> (https://github.com/shinnn)';
parseAuthorName(info); //=> 'Shinnosuke Watanabe'

Installation

Package managers

npm

npm install parse-author-name

Bower

bower install parse-author-name

Duo

const parseAuthorName = require('shinnn/parse-author-name.js');

Standalone

Download the script file directly.

API

parseAuthorName(string)

string: String
Return: String

parseAuthorName('foo <bar> (baz)'); //=> 'foo'
parseAuthorName('<foo> (bar)'); //=> ''

Credit

This project is a fork of somebody authored by Sindre Sorhus. Thanks, sindresorhus.

Licenses

somebody

MIT © Sindre Sorhus

parse-author-name

Copyright (c) 2014 - 2015 Shinnosuke Watanabe

Licensed under the MIT License.

Something went wrong with that request. Please try again.