{"name":"remark-emoji","version":"3.0.0","type":"module","description":"Emoji transformer plugin for Remark","main":"index.js","scripts":{"eslint":"eslint .","prettier":"prettier -c '**/*.js' '**/*.ts'","lint":"npm-run-all -p eslint prettier","test-types":"dtslint types","mocha":"mocha index_test.js","format":"prettier -w '**/*.js' '**/*.ts'","test":"npm-run-all -p mocha test-types"},"repository":{"type":"git","url":"git+https://github.com/rhysd/remark-emoji.git"},"keywords":["markdown","emoji","remark","plugin"],"types":"types/index.d.ts","author":{"name":"rhysd","email":"lin90162@yahoo.co.jp"},"license":"MIT","bugs":{"url":"https://github.com/rhysd/remark-emoji/issues"},"homepage":"https://github.com/rhysd/remark-emoji#readme","devDependencies":{"dtslint":"^4.1.3","eslint":"^7.32.0","mocha":"^9.0.3","npm-run-all":"^4.1.5","prettier":"^2.3.2","remark":"^14.0.1","remark-autolink-headings":"^7.0.0","remark-github":"^11.0.0","remark-slug":"^7.0.0","typescript":"^4.3.5","unified":"^10.1.0"},"dependencies":{"emoticon":"^4.0.0","node-emoji":"^1.11.0","unist-util-visit":"^4.0.0"},"gitHead":"a9519069c191d78c8c81a335ac5caf700d79e22d","_id":"remark-emoji@3.0.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-TKlo99h6EWF1EL1dMUuDbnb+JVObBDliO85zeMOvmTEhwAca2LDS7Xlm7oD9cAg2VmTeS6CihqX4RXBDLe7W1Q==","shasum":"fbbfa922f2a6e053bbfe8c5bd87f6144c596e0ee","tarball":"http://registry-npm.ywwl.com/remark-emoji/download/remark-emoji-3.0.0.tgz","fileCount":5,"unpackedSize":6011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFAbSCRA9TVsSAnZWagAAN9AP/2cbyZRNNftsVkL0C7bZ\n/3Nop+Ar1jdGd4hvtVDzusG0s/ksTEzsqTWG94tLsSRxKVQIXx7rKySbqvHA\nY8wU5xgN2utYQMgt7HyGqrXoWmttBIkV7IrIG4qcORLBca83ooa8YAzFr95f\n9xJnXh9yGaqbTKQ50tWXTQ+J0X/A6txUj0JZ7tadlo5rEYiL6DEEKuEwsAmX\nS2XrZNPMRKsTBo/K5djoyDiO71rP5kJeWHy6CmF1OtTHVqnpGgY/Kw2OQ02a\nG9lPKeZ8P25T8wNBUX7zrBB0FG3mO9g/jMCVkQk83dHedzzIfiqfIjNqZs4k\nI+AgivSe06LXEZEteA5YBWghTl4fGDqrChPn/3FePpSd5m4CSRdfcRHcZrXE\nNuwMhwvqCGoTX1T3MH9MjGzZGB5RDOIEz/UrvqZ9vOjEoLT6LFR5aUi+0ft7\nqGnHaryR6Pl55Wc7eV0rrSZi0TI4CGs6ePWh4dIQ6ml4kTWkYX/dKLKK0LEY\ntVdwp7/I6bbHsIjJr5t4f/rmC+3T9II/GSgYETrQd8j1NORdHVgJABiZU19P\nVNOkz5EIt8EjKP+oK4dh8IM/OU6Q3sqEZa6lZigVsyGBRYXyV0jcdmecgi96\nGFggK7Bvd6ibLBJxzNnTSeIXPi0Fl85I1qtXFWDRwW5eUBd8prfACvLLKVyb\nu6F3\r\n=9tuU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHvs/ikqj05MM1WFjcjj6k70zVdCiD4jBbGOEQBAbOOWAiEAlJwgliS6VzvLltCCXolsSv7gnXkIP+IJPoDkDwhY8Bo="}],"size":2790,"noattachment":false,"key":"/remark-emoji/-/remark-emoji-3.0.0.tgz"},"_npmUser":{"name":"rhysd","email":"lin90162@yahoo.co.jp"},"directories":{},"maintainers":[{"name":"rhysd","email":"lin90162@yahoo.co.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-emoji_3.0.0_1628702418170_0.2886642805176012"},"_hasShrinkwrap":false,"readme":"remark-emoji\n============\n[![CI][ci-badge]][ci]\n[![npm][npm-badge]][npm]\n\n[remark-emoji][npm] is a [remark](https://github.com/remarkjs/remark) plugin to replace `:emoji:` to real UTF-8\nemojis in Markdown text. This plugin is built on top of [node-emoji](https://www.npmjs.com/package/node-emoji).\nThe accessibility support and [Emoticon](https://en.wikipedia.org/wiki/Emoticon) support are optionally available.\n\n## Demo\n\nYou can find a demo in the following [Codesandbox](https://codesandbox.io/p/sandbox/remark-emoji-example-w6yrmm).\n\n## Usage\n\n```\nremark().use(emoji [, options]);\n```\n\n```javascript\nimport { remark } from 'remark';\nimport emoji from 'remark-emoji';\n\nconst doc = 'Emojis in this text will be replaced: :dog::+1:';\nconst processor = remark().use(emoji);\nconst file = await processor.process(doc);\n\nconsole.log(String(file));\n// => Emojis in this text will be replaced: 🐶👍\n```\n\nNote:\n\n- This package is [ESM only][esm-only] from v3.0.0 since remark packages migrated to ESM.\n- This package supports Node.js v18 or later.\n\n## Options\n\n### `options.accessible`\n\nSetting to `true` makes the converted emoji text accessible with `role` and `aria-label` attributes. Each emoji\ntext is wrapped with `<span>` element. The `role` and `aria-label` attribute are not allowed by default. Please\nadd them to the sanitization schema used by remark's HTML transformer. The default sanitization schema is exported\nfrom [rehype-sanitize](https://www.npmjs.com/package/rehype-sanitize) package.\n\nFor example,\n\n```javascript\nimport remarkParse from 'remark-parse';\nimport toRehype from 'remark-rehype';\nimport sanitize, { defaultSchema } from 'rehype-sanitize';\nimport stringify from 'rehype-stringify';\nimport emoji from 'remark-emoji';\nimport { unified } from 'unified';\n\n// Allow using `role` and `aria-label` attributes in transformed HTML document\nconst schema = structuredClone(defaultSchema);\nif ('span' in schema.attributes) {\n    schema.attributes.span.push('role', 'ariaLabel');\n} else {\n    schema.attributes.span = ['role', 'ariaLabel'];\n}\n\n// Markdown text processor pipeline\nconst processor = unified()\n    .use(remarkParse)\n    .use(emoji, { accessible: true })\n    .use(toRehype)\n    .use(sanitize, schema)\n    .use(stringify);\n\nconst file = await processor.process('Hello :dog:!');\nconsole.log(String(file));\n```\n\nyields\n\n```html\nHello <span role=\"img\" aria-label=\"dog emoji\">🐶</span>!\n```\n\nDefault value is `false`.\n\n### `options.padSpaceAfter`\n\nSetting to `true` means that an extra whitespace is added after emoji.\nThis is useful when browser handle emojis with half character length and following character is hidden.\nDefault value is `false`.\n\n### `options.emoticon`\n\nSetting to `true` means that [emoticon](https://www.npmjs.com/package/emoticon) shortcodes are supported (e.g. :-)\nwill be replaced by 😃). Default value is `false`.\n\n## TypeScript support\n\nremark-emoji package contains [TypeScript](https://www.typescriptlang.org/) type definitions. The package is ready\nfor use with TypeScript.\n\nNote that the legacy `node` (or `node10`) resolution at [`moduleResolution`](https://www.typescriptlang.org/tsconfig#moduleResolution)\nis not available since it enforces CommonJS module resolution and this package is ESM only. Please use `node16`,\n`bundler`, or `nodenext` to enable ESM module resolution.\n\n## License\n\nDistributed under [the MIT License](LICENSE).\n\n\n\n[ci-badge]: https://github.com/rhysd/remark-emoji/actions/workflows/ci.yml/badge.svg\n[ci]: https://github.com/rhysd/remark-emoji/actions/workflows/ci.yml\n[npm-badge]: https://badge.fury.io/js/remark-emoji.svg\n[npm]: https://www.npmjs.com/package/remark-emoji\n[esm-only]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n","publish_time":1628702418364,"_cnpm_publish_time":1628702418364,"dist-tags":{"latest":"5.0.2"}}