{"_id":"@cic-it-nancy/i18next-html-entities","name":"@cic-it-nancy/i18next-html-entities","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@cic-it-nancy/i18next-html-entities","version":"1.0.4","description":"Add extended HTML entities decoding to i18next","license":"LGPL-3.0","author":{"name":"CIC-IT Nancy"},"repository":{"type":"git","url":"git+https://github.com/CIC-IT-Nancy/i18next-html-entities.git"},"bugs":{"url":"https://github.com/CIC-IT-Nancy/i18next-html-entities/issues"},"contributors":[{"name":"Pierre 'AlasDiablo' M","url":"https://github.com/AlasDiablo"}],"scripts":{"build":"tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json","prepublish":"npm run build"},"type":"module","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","types":"./types/index.d.ts","dependencies":{"entities":"^7.0.0"},"peerDependencies":{"i18next":"^25.6.0 || ^26.0.0"},"devDependencies":{"@eslint/js":"^9.39.2","@stylistic/eslint-plugin":"^5.6.1","eslint":"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-import":"^2.32.0","eslint-plugin-prettier":"^5.5.4","globals":"^16.5.0","i18next":"^25.6.0","typescript":"^5.5.3","typescript-eslint":"^8.50.0"},"gitHead":"a5ee327fc737c1eb79bc736d9d06d0076c547300","_id":"@cic-it-nancy/i18next-html-entities@1.0.4","homepage":"https://github.com/CIC-IT-Nancy/i18next-html-entities#readme","_nodeVersion":"24.20.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-CztqAqJWVkewbkUdt5NrpzFEO8p8WEyqBtM6JExLGP4T5r7P1FUw5GGza19CRMdTZMX+x5am3GTiYBfq1jCe7g==","shasum":"65c9465ddf6e39d5a2d426b9191e09568331550e","tarball":"https://registry.npmjs.org/@cic-it-nancy/i18next-html-entities/-/i18next-html-entities-1.0.4.tgz","fileCount":7,"unpackedSize":11564,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5pqHR25PXhni098FwB8espe+cv1LYhHaCdVN17ZWW+wIgWnfAeLwImqdlRp7H930X/vLbbS1TdtHzlBUKe4oti64="}]},"_npmUser":{"name":"alasdiablo","email":"marcolet.pierre@laposte.net"},"directories":{},"maintainers":[{"name":"naruto-kyun","email":"fauvel.marc@gmail.com"},{"name":"alasdiablo","email":"marcolet.pierre@laposte.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/i18next-html-entities_1.0.4_1788508214144_0.7990840803594921"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-04T07:50:13.933Z","1.0.4":"2026-09-04T07:50:14.278Z","modified":"2026-09-04T07:50:14.657Z"},"maintainers":[{"name":"naruto-kyun","email":"fauvel.marc@gmail.com"},{"name":"alasdiablo","email":"marcolet.pierre@laposte.net"}],"description":"Add extended HTML entities decoding to i18next","homepage":"https://github.com/CIC-IT-Nancy/i18next-html-entities#readme","repository":{"type":"git","url":"git+https://github.com/CIC-IT-Nancy/i18next-html-entities.git"},"contributors":[{"name":"Pierre 'AlasDiablo' M","url":"https://github.com/AlasDiablo"}],"author":{"name":"CIC-IT Nancy"},"bugs":{"url":"https://github.com/CIC-IT-Nancy/i18next-html-entities/issues"},"license":"LGPL-3.0","readme":"# I18Next HTML Entities\r\n\r\nAdds extended HTML entities decoding to i18next via a lightweight postProcessor built on top of the `entities` package.\r\n\r\nUseful when your translations contain HTML character references like `&eacute;`, `&#233;`, or `&#xE9;` and you want them\r\ndecoded in the final string.\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```\r\nnpm install @cic-it-nancy/i18next-html-entities i18next\r\n```\r\n\r\n---\r\n\r\n## Usage\r\n\r\nThe postProcessor instance is exported as the default export. It registers under the name `I18NextHTMLEntities` and\r\ndecodes values using `entities.decodeHTML`.\r\n\r\n```ts\r\nimport i18next from 'i18next';\r\nimport htmlEntities from '@cic-it-nancy/i18next-html-entities';\r\nimport { DecodingMode } from 'entities';\r\n\r\ni18next\r\n  .use(htmlEntities) // registers the postProcessor\r\n  .init({\r\n    // ...your config\r\n    postProcess: ['I18NextHTMLEntities'],\r\n  });\r\n\r\n// Optionally configure decoding mode (defaults to DecodingMode.Legacy)\r\nhtmlEntities.setOptions({\r\n  mode: /* DecodingMode value from 'entities' */ DecodingMode.Legacy,\r\n});\r\n\r\n// Given a translation value \"Hello &amp; welcome, Jos\\u00E9! &eacute; = &#233; = &#xE9;\"\r\nconst text = i18next.t('greeting');\r\n// -> \"Hello & welcome, José! é = é = é\"\r\n```\r\n\r\n---\r\n\r\n## Notes\r\n\r\n- Peer dependency: `i18next` — make sure your app provides a compatible version.\r\n- This package uses the `entities` library for robust HTML entity decoding.\r\n\r\n---\r\n\r\n## Authors & Contributors\r\n\r\n- **CIC-IT Nancy** — Author\r\n- **Pierre 'AlasDiablo' M** ([GitHub](https://github.com/AlasDiablo)) — Contributor\r\n\r\n---\r\n\r\n## Licence\r\n\r\nGNU Lesser General Public License v3.0 (LGPL-3.0) - CIC-IT Nancy\r\n","readmeFilename":"README.md","_rev":"1-ca2fc726664896481a916ee2806a6679"}