New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

emojideas

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emojideas

Suggest Emoji based on name or keyword.

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Emojideas

Text-to-emoji suggestion library with a Lunr and emojilib backend. Suggestions are based on emoji name and keywords.

Usage

Install the library:

npm install --save emojideas
# or
yarn add emojideas

Require the module, create an instance, and call the suggest function on some text:

const Emojideas = require('emojideas');

const e = new Emojideas();

e.suggest('aerial tramway');
// => [ '🚡' ]

Results are ordered based on the score calculated by Lunr.

Options

The constructor accepts several options.

optiondescription
fuzzylevel of fuzzyness to apply to all Lunr queries (default: 0)
nameBoostweight applied to emoji name relative to keywords when ordering results (default: 3)
formatOutputfunction passed each Lunr result to format output (default: el => el.ref)
require('emojilib')['🚡'];
// => [ 'aerial_tramway', 'transportation', 'vehicle', 'ski' ]

const f = new Emojideas({ fuzzy: 1 });
f.suggest('trumway');
// => [ '🚡' ]

const g = new Emojideas({ nameBoost: 0 });
g.suggest('aerial tramway');
// => []

const h = new Emojideas({ formatOutput: el => [el.ref, el.score] });
h.suggest('aerial tramway');
// => [ [ '🚡', 28.254572762652064 ] ]

Lunr

All queries are passed directly to the Lunr backend, and can therefore use the Lunr syntax, except when the fuzzy option has been set.

require('emojilib')['🚊'];
// => [ 'tram', 'transportation', 'vehicle' ]

const e = new Emojideas();

e.suggest('tram');
// => [ '🚊', '🚋' ]

e.suggest('tram*');
// => [ '🚊', '🚡', '🚋' ]

e.suggest('aerial tram*');
// => [ '🚡', '🚊', '🚋' ]

e.suggest('tram* -tram');
// => [ '🚡' ]

CLI

A command line search implementation based on Commander is included.

Install the library globally:

npm install -g emojideas
# or
yarn global add emojideas

Run a query:

emojideas aerial tramway
# => [ '🚡' ]

To see available options:

emojideas --help

Keywords

FAQs

Package last updated on 04 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc