https://github.com/shinnn/parse-author-name.js
Parse the name of contact info like `name <mail> (url)`
https://github.com/shinnn/parse-author-name.js
Last synced: 4 months ago
JSON representation
Parse the name of contact info like `name <mail> (url)`
- Host: GitHub
- URL: https://github.com/shinnn/parse-author-name.js
- Owner: shinnn
- Created: 2014-11-04T08:02:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-14T08:48:05.000Z (over 9 years ago)
- Last Synced: 2024-10-18T19:59:15.905Z (9 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSES.md
Awesome Lists containing this project
README
# parse-author-name
[](https://www.npmjs.com/package/parse-author-name)
[](https://github.com/shinnn/parse-author-name.js/releases)
[](https://travis-ci.org/shinnn/parse-author-name.js)
[](https://coveralls.io/r/shinnn/parse-author-name.js)
[](https://david-dm.org/shinnn/parse-author-name.js#info=devDependencies)Parse the name of contact info like `name (url)`
```javascript
let info = 'Shinnosuke Watanabe (https://github.com/shinnn)';
parseAuthorName(info); //=> 'Shinnosuke Watanabe'
```## Installation
### Package managers
#### [npm](https://www.npmjs.com/)
```
npm install parse-author-name
```#### [Bower](http://bower.io/)
```
bower install parse-author-name
```#### [Duo](http://duojs.org/)
```javascript
const parseAuthorName = require('shinnn/parse-author-name.js');
```### Standalone
[Download the script file directly.](https://raw.githubusercontent.com/shinnn/parse-author-name.js/master/parse-author-name.js)
## API
### parseAuthorName(*string*)
*string*: `String`
Return: `String````javascript
parseAuthorName('foo (baz)'); //=> 'foo'
parseAuthorName(' (bar)'); //=> ''
```## Credit
This project is a fork of [somebody](https://github.com/sindresorhus/somebody) authored by [Sindre Sorhus](http://sindresorhus.com/hi/). Thanks, [sindresorhus](https://github.com/sindresorhus).
## Licenses
### [somebody](./LICENSES.md#somebody)
> MIT © [Sindre Sorhus](http://sindresorhus.com/)
### [parse-author-name](./LICENSES.md#parse-author-name)
Copyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under the MIT License.