Comparing version 7.0.0 to 7.1.0
{ | ||
"name": "gemoji", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "GitHub emoji: gemoji", | ||
@@ -37,7 +37,7 @@ "license": "MIT", | ||
"c8": "^7.0.0", | ||
"mdast-zone": "^4.0.0", | ||
"node-fetch": "^2.0.0", | ||
"mdast-zone": "^5.0.0", | ||
"node-fetch": "^3.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"rimraf": "^3.0.0", | ||
@@ -47,12 +47,12 @@ "tape": "^5.0.0", | ||
"typescript": "^4.0.0", | ||
"unist-builder": "^2.0.0", | ||
"xo": "^0.38.0" | ||
"unist-builder": "^3.0.0", | ||
"xo": "^0.46.0" | ||
}, | ||
"scripts": { | ||
"prepack": "npm run build && npm run format", | ||
"build": "rimraf \"*.d.ts\" && tsc && type-coverage", | ||
"generate": "node script/crawl-data && node script/build-data", | ||
"generate": "node script/crawl-data.js && node script/build-data.js", | ||
"prepublishOnly": "npm run build && npm run format", | ||
"build": "rimraf \"script/**/*.d.ts\" \"*.d.ts\" && tsc && type-coverage", | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
"test-api": "node test.js", | ||
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js", | ||
"test-api": "node --conditions development test.js", | ||
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api", | ||
"test": "npm run generate && npm run build && npm run format && npm run test-coverage" | ||
@@ -71,6 +71,3 @@ }, | ||
"rules": { | ||
"import/no-mutable-exports": "off", | ||
"camelcase": "off", | ||
"no-var": "off", | ||
"prefer-arrow-callback": "off" | ||
"camelcase": "off" | ||
} | ||
@@ -91,3 +88,3 @@ }, | ||
], | ||
"./script/build-support.cjs" | ||
"./script/build-support.js" | ||
] | ||
@@ -94,0 +91,0 @@ }, |
190
readme.md
@@ -8,12 +8,44 @@ # gemoji | ||
Gemoji (**G**itHub **Emoji**) contains info (category, description, names, and | ||
tags) on Emoji and GitHub “Gemoji” shortcodes. | ||
Info on gemoji. | ||
## Contents | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`gemoji`](#gemoji-1) | ||
* [`nameToEmoji`](#nametoemoji) | ||
* [`emojiToName`](#emojitoname) | ||
* [Types](#types) | ||
* [List of gemoji](#list-of-gemoji) | ||
* [Data](#data) | ||
* [Compatibility](#compatibility) | ||
* [Security](#security) | ||
* [Related](#related) | ||
* [Contribute](#contribute) | ||
* [Disclaimer](#disclaimer) | ||
* [License](#license) | ||
## What is this? | ||
This package contains info on gemoji (**G**itHub **Emoji**). | ||
Gemoji are the shortcodes that GitHub uses to represent emoji. | ||
For example, `:grinning:` can be used for `😀`. | ||
## When should I use this? | ||
Use this package if you need: | ||
* info on gemoji, such as associated tags, description, and | ||
category | ||
* to map between emoji and names and vice versa | ||
* to list emoji or names | ||
## Install | ||
This package is ESM only: Node 12+ is needed to use it and it must be `import`ed | ||
instead of `require`d. | ||
This package is [ESM only][esm]. | ||
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]: | ||
[npm][]: | ||
```sh | ||
@@ -23,4 +55,44 @@ npm install gemoji | ||
In Deno with [Skypack][]: | ||
```js | ||
import {gemoji} from 'https://cdn.skypack.dev/gemoji@7?dts' | ||
``` | ||
In browsers with [Skypack][]: | ||
```html | ||
<script type="module"> | ||
import {gemoji} from 'https://cdn.skypack.dev/gemoji@7?min' | ||
</script> | ||
``` | ||
## Use | ||
See examples below. | ||
## API | ||
This package exports the following identifiers: `gemoji`, `nameToEmoji`, | ||
`emojiToName`. | ||
There is no default export. | ||
### `gemoji` | ||
List of info objects (`Array<Gemoji>`). | ||
Each `Gemoji` has the following fields: | ||
* `emoji` (`string`) | ||
— example: `😀` | ||
* `names` (`Array<string>`) | ||
— example: `['grinning']` | ||
* `tags` (`Array<string>`) | ||
— example: `['smile', 'happy']` | ||
* `description` (`string`) | ||
— example: `grinning face` | ||
* `category` (`string`) | ||
— example: `Smileys & Emotion` | ||
###### Example | ||
```js | ||
@@ -57,16 +129,2 @@ import {gemoji} from 'gemoji' | ||
}, | ||
{ | ||
emoji: '😁', | ||
names: ['grin'], | ||
tags: [], | ||
description: 'beaming face with smiling eyes', | ||
category: 'Smileys & Emotion' | ||
}, | ||
{ | ||
emoji: '😆', | ||
names: ['laughing', 'satisfied'], | ||
tags: ['happy', 'haha'], | ||
description: 'grinning squinting face', | ||
category: 'Smileys & Emotion' | ||
}, | ||
// … | ||
@@ -76,19 +134,20 @@ ] | ||
### Get emoji | ||
### `nameToEmoji` | ||
Map of names (`100`) to emoji (`💯`) (`Record<string, string>`). | ||
###### Example | ||
```js | ||
import {nameToEmoji} from 'gemoji' | ||
console.log(nameToEmoji.cat) | ||
console.log(nameToEmoji.poop) | ||
console.log(nameToEmoji.cat) //=> 🐱 | ||
console.log(nameToEmoji.poop) //=> 💩 | ||
``` | ||
Yields: | ||
### `emojiToName` | ||
```txt | ||
🐱 | ||
💩 | ||
``` | ||
Map of emoji (`😀`) to names (`grinning`) (`Record<string, string>`). | ||
### Get name | ||
###### Example | ||
@@ -98,41 +157,15 @@ ```js | ||
console.log(emojiToName['🐶']) | ||
console.log(emojiToName['\uD83D\uDCA9']) | ||
console.log(emojiToName['🐶']) //=> dog | ||
console.log(emojiToName['\uD83D\uDCA9']) //=> hankey | ||
``` | ||
Yields: | ||
## Types | ||
```txt | ||
dog | ||
hankey | ||
``` | ||
This package is fully typed with [TypeScript][]. | ||
It exports an additional `Gemoji` type that models its respective interface. | ||
## API | ||
## List of gemoji | ||
This package exports the following identifiers: `gemoji`, `nameToEmoji`, | ||
`emojiToName`. | ||
There is no default export. | ||
See [`support.md`][support]. | ||
### `gemoji` | ||
`Info[]`, where each `Info` is `Object` with: | ||
* `emoji`: `string`, example: `😀` | ||
* `names`: `string[]`, example: `['grinning']` | ||
* `tags`: `string[]`, example: `['smile', 'happy']` | ||
* `description`: `string`, example: `grinning face` | ||
* `category`: `string`, example: `Smileys & Emotion` | ||
### `nameToEmoji` | ||
`Object.<string, string>` — map names (`100`) to emoji (`💯`). | ||
### `emojiToName` | ||
`Object.<string, string>` — map names (`😀`) to emoji (`grinning`). | ||
## Supported Gemoji | ||
See [support.md][support]. | ||
## Data | ||
@@ -147,9 +180,19 @@ | ||
## Compatibility | ||
This package is at least compatible with all maintained versions of Node.js. | ||
As of now, that is Node.js 12.20+, 14.14+, and 16.0+. | ||
It also works in Deno and modern browsers. | ||
## Security | ||
This package is safe. | ||
## Related | ||
* [`emoji-emotion`](https://github.com/words/emoji-emotion) | ||
— List of emoji rated for valence | ||
* [`emoticon`](https://github.com/wooorm/emoticon) | ||
— Info on ASCII emoticons | ||
* [`strip-skin-tone`](https://github.com/wooorm/strip-skin-tone) | ||
* [`words/emoji-emotion`](https://github.com/words/emoji-emotion) | ||
— list of emoji rated for valence | ||
* [`wooorm/emoticon`](https://github.com/wooorm/emoticon) | ||
— info on ASCII emoticons | ||
* [`wooorm/strip-skin-tone`](https://github.com/wooorm/strip-skin-tone) | ||
— Strip skin-tones from emoji | ||
@@ -159,2 +202,7 @@ * [`wooorm.com/checkmoji`](https://wooorm.com/checkmoji/) | ||
## Contribute | ||
Yes please! | ||
See [How to Contribute to Open Source][contribute]. | ||
## Disclaimer | ||
@@ -188,2 +236,4 @@ | ||
[skypack]: https://www.skypack.dev | ||
[license]: license | ||
@@ -193,2 +243,8 @@ | ||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c | ||
[typescript]: https://www.typescriptlang.org | ||
[contribute]: https://opensource.guide/how-to-contribute/ | ||
[support]: support.md | ||
@@ -195,0 +251,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
246
0
350002
16438