{"name":"ent","description":"Encode and decode HTML entities","version":"2.2.2","repository":{"type":"git","url":"git+https://github.com/ljharb/ent.git"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"main":"./index.js","sideEffects":false,"keywords":["entities","entitify","entity","html","encode","decode"],"license":"MIT","scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublishOnly":"safe-publish-latest && npm run build","prepublish":"not-in-publish || npm run prepublishOnly","lint":"eslint --ext=js,mjs .","postlint":"evalmd README.md","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx npm@'>= 10.2' audit --production","build":"node build","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"dependencies":{"call-bound":"^1.0.3","es-errors":"^1.3.0","punycode":"^1.4.1","safe-regex-test":"^1.1.0"},"devDependencies":{"@ljharb/eslint-config":"^21.1.1","auto-changelog":"^2.5.0","encoding":"^0.1.13","eslint":"=8.8.0","evalmd":"^0.0.19","in-publish":"^2.0.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.9.0"},"engines":{"node":">= 0.4"},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true},"publishConfig":{"ignore":[".github/workflows","build"]},"testling":{"files":"test/*.js"},"_id":"ent@2.2.2","gitHead":"d6e1b2a88f067c75fc5f1ff106770ea7635d8df6","bugs":{"url":"https://github.com/ljharb/ent/issues"},"homepage":"https://github.com/ljharb/ent#readme","_nodeVersion":"23.4.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-kKvD1tO6BM+oK9HzCPpUdRb4vKFQY/FPTFmurMvh6LlN68VMrdj77w8yp51/kDbpkFOS9J8w5W6zIzgM2H8/hw==","shasum":"22a5ed2fd7ce0cbcff1d1474cf4909a44bdb6e85","tarball":"http://registry-npm.ywwl.com/ent/download/ent-2.2.2.tgz","fileCount":15,"unpackedSize":115003,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC27O6u53NRyvPL1tKBK5UTJyymbPyDV0V6e4bjTX3DMAIhANhDKGjifYYHYkE4fICMR7SZaRAM504vQnilTKApCImp"}],"size":30028,"noattachment":false,"key":"/ent/-/ent-2.2.2.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"},{"name":"ljharb","email":"ljharb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ent_2.2.2_1734389328693_0.09956148175242996"},"_hasShrinkwrap":false,"readme":"# ent <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nEncode and decode HTML entities\n\n# example\n\n``` js\nvar ent = require('ent');\nconsole.log(ent.encode('<span>©moo</span>'))\nconsole.log(ent.decode('&pi; &amp; &rho;'));\n```\n\n```\n&#60;span&#62;&#169;moo&#60;/span&#62;\nπ & ρ\n```\n\n![ent](https://web.archive.org/web/20170823120015if_/http://substack.net/images/ent.png)\n\n# methods\n\n``` js\nvar ent = require('ent');\nvar encode = require('ent/encode');\nvar decode = require('ent/decode');\n```\n\n## encode(str, opts={})\n\nEscape unsafe characters in `str` with html entities.\n\nBy default, entities are encoded with numeric decimal codes.\n\nIf `opts.numeric` is false or `opts.named` is true, encoding will used named\ncodes like `&pi;`.\n\nIf `opts.special` is set to an Object, the key names will be forced\nto be encoded (defaults to forcing: `<>'\"&`). For example:\n\n``` js\nconsole.log(encode('hello', { special: { l: true } }));\n```\n\n```\nhe&#108;&#108;o\n```\n\n## decode(str)\n\nConvert html entities in `str` back to raw text.\n\n# credits\n\nHTML entity tables are from the official\n[`entities.json`](https://html.spec.whatwg.org/entities.json) file for\nthe [whatwg HTML\nspecification](https://html.spec.whatwg.org/multipage/syntax.html#named-character-references).\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install ent\n```\n\n# license\n\nMIT\n\n[package-url]: https://npmjs.org/package/ent\n[npm-version-svg]: https://versionbadg.es/ljharb/ent.svg\n[deps-svg]: https://david-dm.org/ljharb/ent.svg\n[deps-url]: https://david-dm.org/ljharb/ent\n[dev-deps-svg]: https://david-dm.org/ljharb/ent/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/ent#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/ent.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/ent.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/ent.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=ent\n[codecov-image]: https://codecov.io/gh/ljharb/ent/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/ent/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/ent\n[actions-url]: https://github.com/ljharb/ent/actions\n","publish_time":1734389329019,"_cnpm_publish_time":1734389329019,"dist-tags":{"latest":"2.2.2","v0-backport":"0.0.8"}}