GithubHelp home page GithubHelp logo

sindresorhus / emoj Goto Github PK

View Code? Open in Web Editor NEW
2.3K 17.0 86.0 589 KB

Find relevant emoji from text on the command-line :open_mouth: :sparkles: :raised_hands: :horse: :boom: :see_no_evil:

License: MIT License

JavaScript 23.00% TypeScript 77.00%

emoj's Introduction

emoj

Find relevant emoji from text on the command-line

Uses a local emoji database.

Install

Ensure you have Node.js 18+ installed, and then run the following:

npm install --global emoj

Works best on macOS and Linux. Older Linux distributions don't support color emoji in the terminal, but newer ones (like Ubuntu 18.04 and Fedora 28) do. On Linux, I would recommend installing Emoji One for full emoji coverage. Doesn't really work on Windows.

Usage

$ emoj --help

  Usage
    $ emoj [text]

  Example
    $ emoj 'i love unicorns'
    πŸ¦„  🎠  🐴  🐎  ❀  ✨  🌈

  Options
    --copy -c       Copy the first emoji to the clipboard
    --skin-tone -s  Set and persist the default emoji skin tone (0 to 5)

  Run it without arguments to enter the live search
  Use the up/down keys during live search to change the skin tone

Related

emoj's People

Contributors

adrianblynch avatar arnabsen1729 avatar codedotjs avatar jonnybel avatar richienb avatar sindresorhus avatar tannerntannern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emoj's Issues

Better tests

Should be much easier now that we're using Ink.

@vadimdemedes This could be nice example for Ink users on how to test their Ink usage.

Make the types stricter

Basically remove

"strict": false
and

emoj/package.json

Lines 71 to 75 in 46477ce

"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/naming-convention": "off"
and fix all the issues.

Help welcome πŸ™

Add ability to easily copy an emoji

I'm thinking something like this (in the interactive prompt):

β€Ί unicorns
πŸ¦„  🎠  🐴  🌈  🐎  ✨  πŸ“
 1   2   3   4   5   6   7

And you can use for example Ctrl+1 to copy the first emoji.

Need people's thoughts. Any way to better present / handle this?
The goal is to quickly be able to find and get a relevant emoji.

Should also have a -c, --copy flag for non-interactive mode.

SyntaxError: Use of const in strict mode.

$ emoj 'i love unicorns'
/home/mingus/.nvm/versions/node/v0.12.7/lib/node_modules/emoj/cli.js:3
const readline = require('readline');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

Please check out emoji-finder

Hey Sindre!

I really love emoj. So much that I got inspired to start writing my own clone of it. As it evolved now I think it has reached a point where it turns out to be more than just a clone, rather like a successor to emoj. Please check out https://github.com/dematerializer/emoji-finder and tell me what you think of it.

Many thanks!

  • Andy

2.0.0 fails with RequestError: certificate has expired

Latest version (2.0.0) is broken:

➜  ~ emoj horse                                                                                                                                                                        09:26:15
RequestError: certificate has expired
    at ClientRequest.req.once.err (/Users/dbus/.nvm/versions/node/v8.8.1/lib/node_modules/emoj/node_modules/got/index.js:111:21)
    at Object.onceWrapper (events.js:314:30)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at TLSSocket.socketErrorListener (_http_client.js:385:9)
    at emitOne (events.js:115:13)
    at TLSSocket.emit (events.js:210:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

The certificate for https://emoji.getdango.com/api/emoji seems to be invalid.

Returns no text

Screen Shot 2020-03-07 at 20 13 17

The emoj CLI is returning absolutely no emojis at all, not even πŸ¦„unicorns!

The interactive mode doesn't work either. Returns nothing.

I am on macOS Catalina, package manager is Yarn.

[Request] drool β†’ 🀀

With the current version if I search for drool it does not find the drool face: 🀀

Only when I search for drooling it will find it.

I'd like to request that 🀀 shows up with just drool. Is this possible?

Is it related to fuzzy text search?

Copy functionality doesn't work under sway

Trying to use Emoj under Wayland with Sway compositor and Kitty terminal emulator. The "quick copy" functionality does not seem to work, so I have to select the emoji from the live search and copy it manually, which is pretty unwieldy.

Dango API seems to be paid.

How does this app use Dango API. Dango API seems to be paid and it seems you have to have a license from this Dango API page.
How are you using the dango api in this project? Are there special permissions for Open Source Project.

Enhance 3rd party result with local information

Issuehunt badges

Some emoji's just aren't findable with the 3rd party service. For instance sindresorhus/alfred-emoj#14. What would it take to enhance the results?

Could we bundle a local db to add emoji that are hard to find or just aren't in the 3rd party service?


IssueHunt Summary

stroncium stroncium has been rewarded.

Backers (Total: $80.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Add snapcraft.yaml file

Today I created a snap of emoj and this PR will contain a snapcraft.yaml to enable building of an emoj snap. I've tested the snap to make sure it works as expected, and find no issues so far.

I'd love to hear if you are generally interested in your software being available as a snap and if you could imagine shipping the snapcraft.yaml file in your source repository for easier publishing.

Background info

If you haven't heard of snaps yet, they are self-contained apps, which can be used on a multitude of Linux systems. Via seccomp, apparmor and other Linux security features, they provide great security for users, uploads to the store are available within seconds and you have
full control over your relevant stack.

Snaps can be installed by millions of users: Ubuntu 16.04 LTS and later have snapd installed by default and many other Linux distributions, like Arch, Debian, Gentoo, Fedora, openSUSE, OpenEmbedded, Yocto and OpenWRT made snapd (which powers the snap experience) available as well.

Publishing

Uploading to the store can be done via the command line and there are multiple release channels available, so users can choose between for example stable, beta and alpha releases. You could even hook up snapcraft upload with Travis to auto-publish release tags or nightly builds. The process for this is very simple:

Once:

Request: Auto combine multiple positional arguments

Since the only positional argument is the search text, why not accept multiple arguments and internally join them with spaces into a single search, so that the user doesn't need to quote the text?

In other words, make it so that running these commands have the same result:

$ emoj horse unicorn
🐴  🐎  πŸ‡  🎠
$ emoj 'horse unicorn'
🐴  πŸ¦„  🐎  πŸ‡  🎠  🌈

And these:

$ emoj i love unicorns

$ emoj 'i love unicorns'
😍  πŸ₯°  😘  πŸ˜—  😚  😻  🀟

EDIT: Hmm, I'm noticing how different the result for that last search are from the same search in the README.

Error: Use of const in strict mode

When running the program I get the following in my terminal:

$ emoj --help
/usr/local/lib/node_modules/emoj/cli.js:3
const readline = require('readline');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

I'd just modify the code but I'm not sure if you put const there for a reason...

Windows support

I've tried to use it on Windows 7 and it appears to be not working correctly. All I can see is below
capture

Node.js version 4.4.5.

RequestError: certificate has expired

Hello,

On Linux Mint 18.3 Sylvia.

I used emoj for a while but since yesterday I have this message:

$ ξ‚° emoj cat
RequestError: certificate has expired
at ClientRequest.req.once.err (/snap/emoj/53/lib/node_modules/emoj/node_modules/got/index.js:111:21)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

Any suggestions?

Thank you.

Add option to retry without exiting

Sometimes I need to copy multiple emojis. But It closes upon enter. There should be option to keep the search feature open even after copying a emoji instead of exiting.

RequestError: certificate has expired

When I tried alfred and typed emoj laugh today, I got:

RequestError: certificate has expired
at ClientRequest.req.once.err (/usr/local/lib/node_modules/alfred-emoj/node_modules/got/index.js:182:22)

Skin tone

I always use skin tone 5 (well that's what Slack calls it anyway) because it closely lines up with my skin color. :-) Would love a way to specify that as an arg.

Proxy Support?

I'm behind a proxy and getting a timeout. Any way to configure this thing to use it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.