emojideas
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "emojideas", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Suggest Emoji based on name or keyword.", | ||
@@ -10,5 +10,7 @@ "main": "index.js", | ||
}, | ||
"devDependencies": {}, | ||
"devDependencies": { | ||
"mocha": "^5.2.0" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha" | ||
}, | ||
@@ -15,0 +17,0 @@ "repository": { |
# Emojideas | ||
Text-to-emoji suggestion library with a [Lunr](https://github.com/olivernn/lunr.js) and [emojilib](https://github.com/muan/emojilib) backend. | ||
Text-to-emoji suggestion library with a [Lunr](https://github.com/olivernn/lunr.js) and [emojilib](https://github.com/muan/emojilib) backend. Suggestions are based on emoji name and keywords. | ||
@@ -39,6 +39,6 @@ ## Usage | ||
require('emojilib').lib.aerial_tramway; | ||
// => { keywords: [ 'transportation', 'vehicle', 'ski' ], | ||
// char: '🚡', | ||
// fitzpatrick_scale: false, | ||
// category: 'travel_and_places' } | ||
// => { keywords: [ 'transportation', 'vehicle', 'ski' ], | ||
// char: '🚡', | ||
// fitzpatrick_scale: false, | ||
// category: 'travel_and_places' } | ||
@@ -58,2 +58,3 @@ let e = new Emojideas({ excludeCategories: ['travel_and_places'] }); | ||
let h = new Emojideas({ formatOutput: el => [el.ref, el.score] }); | ||
h.suggest('aerial tramway'); | ||
// => [ [ '🚡', 25.417660356531634 ] ] | ||
@@ -65,1 +66,23 @@ ``` | ||
All queries are passed directly to the Lunr backend, and can therefore use the [Lunr syntax](https://lunrjs.com/guides/searching.html), except when the `fuzzy` option has been set. | ||
```javascript | ||
require('emojilib').lib.tram; | ||
// => { keywords: [ 'transportation', 'vehicle' ], | ||
// char: '🚊', | ||
// fitzpatrick_scale: false, | ||
// category: 'travel_and_places' } | ||
let e = new Emojideas(); | ||
e.suggest('tram'); | ||
// => [ '🚊' ] | ||
e.suggest('tram*'); | ||
// => [ '🚊', '🚡' ] | ||
e.suggest('aerial tram*'); | ||
// => [ '🚡', '🚊' ] | ||
e.suggest('tram* -tram'); | ||
// => [ '🚡' ] | ||
``` |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
9176
5
142
0
86
1