Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 days 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 (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-14T08:48:05.000Z (over 8 years ago)
- Last Synced: 2024-10-11T20:28:28.757Z (about 1 month 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
[![NPM version](https://img.shields.io/npm/v/parse-author-name.svg)](https://www.npmjs.com/package/parse-author-name)
[![Bower version](https://img.shields.io/bower/v/parse-author-name.svg)](https://github.com/shinnn/parse-author-name.js/releases)
[![Build Status](https://travis-ci.org/shinnn/parse-author-name.js.svg?branch=master)](https://travis-ci.org/shinnn/parse-author-name.js)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/parse-author-name.js.svg?style=flat)](https://coveralls.io/r/shinnn/parse-author-name.js)
[![devDependency Status](https://david-dm.org/shinnn/parse-author-name.js/dev-status.svg)](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.