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 |
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.
npm install --save suggested-name
-
npm run build
- produces production version under thelib
folder -
npm run dev
- produces development version and runs a watcher -
npm run test
- runs the tests
- initial relase
This project was created using webpack-library-starter.
This project is licensed under the MIT license.