Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.79 KB

README.md

File metadata and controls

49 lines (39 loc) · 1.79 KB

Suggested name npm version Build Status

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

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:

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.

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.

License

This project is licensed under the MIT license.