Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/platan/suggested-name
JavaScript library for suggesting common name
https://github.com/platan/suggested-name
Last synced: about 1 month ago
JSON representation
JavaScript library for suggesting common name
- Host: GitHub
- URL: https://github.com/platan/suggested-name
- Owner: platan
- License: mit
- Created: 2017-01-10T21:24:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-22T06:15:05.000Z (almost 2 years ago)
- Last Synced: 2024-04-26T21:22:29.479Z (9 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/suggested-name
- Size: 1.73 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Suggested name [![npm version](https://badge.fury.io/js/suggested-name.svg)](https://badge.fury.io/js/suggested-name) [![Build Status](https://travis-ci.org/platan/suggested-name.svg?branch=master)](https://travis-ci.org/platan/suggested-name)
JavaScript library for suggesting common name. Suggested name is composed of words occurring in all given names.names (input)|suggested name (output)
--- | ---
**Fire** Kids Edition **Tablet 7" Display Wi-Fi 8 GB** Black
**Fire Tablet 7" Display Wi-Fi 8 GB** Magneta
**Fire Tablet 7" Display Wi-Fi 8 GB** Blue|**Fire Tablet 7" Display Wi-Fi 8 GB**## Usage
```javascript
var suggestedName = require('suggested-name');suggestedName([
'Fire Kids Edition Tablet 7" Display Wi-Fi 8 GB Black',
'Fire Tablet 7" Display Wi-Fi 8 GB Magneta',
'Fire Tablet 7" Display Wi-Fi 8 GB Blue'
]); // = 'Fire Tablet 7" Display Wi-Fi 8 GB'
```
Remove given characters from names:
```javascript
suggestedName([
'Fire Tablet (7" Display Wi-Fi 8 GB Black)',
'Fire Tablet (7" Display Wi-Fi 8 GB Magneta)',
'Fire Tablet (7" Display Wi-Fi 8 GB Blue)'
], ['(', ')']); // = 'Fire Tablet 7" Display Wi-Fi 8 GB'
```More examples can be found in [tests](http://github.com/platan/suggested-name/blob/master/test/index.spec.js).
## Installation
```
npm install --save suggested-name
```## Features
## Scripts
* `yarn build` - produces production version under the `lib` folder
* `yarn dev` - produces development version and runs a watcher
* `yarn test` - runs the tests## Changelog
### 0.1.0 (2017-01-10)
- initial release## Credits
This project was created using [webpack-library-starter](http://github.com/krasimir/webpack-library-starter).## License
This project is licensed under the [MIT license](http://github.com/platan/suggested-name/blob/master/LICENSE).