Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

gpt-emoji

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpt-emoji

Get the emoji(s) that best represent the given text/concept.

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

gpt-emoji

npm version test coverage

Get the emoji(s) that best represent the given text/concept.

Uses OpenAI's GPT-3.5 gpt-3.5-turbo API.

Table of contents

Setup

Install it:

npm i gpt-emoji

Set your OpenAI key:

export OPENAI_API_KEY=sk-...

API

getEmojis()

ParameterTypeDescription
textstring or string[]The string(s) to get emojis for.
optionsobjectOptional options for the function.
options.countnumberThe number of emojis to represent the text with. Default: The AI chooses how many are needed.

Returns a string array of emojis that best represent the given text, or a nested array of strings if multiple texts are given.

Note that this function is non-deterministic and could return different emojis each time.

Usage

A single string:

import { getEmojis } from 'gpt-emoji';

getEmojis('japanese cherry blossom festival');

// ['🌸', '🇯🇵, '🎎']

Multiple strings and a custom count:

import { getEmojis } from 'gpt-emoji';

getEmojis(['atomic clock', 'machine learning'], { count: 2 });

// [ [ '⏰', '☢️' ], [ '🤖', '🧠' ] ]

Keywords

emoji

FAQs

Package last updated on 19 Mar 2023

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