@favware/unescape

中文文档
1.3.2发布于 2020/01/23MITTypeScriptESM + CJS零依赖近 30 天下载 2573

Convert HTML entities to HTML characters, e.g. > converts to >.

此软件包已被标记为弃用

Work on this package has stopped in favor of confusables (https://www.npmjs.com/package/confusables) from developer gc (https://github.com/gc), a package which I have also contributed to and has a much better feature set and far better performance

原始使用文档

DEPRECATED

Work on this package has stopped in favor of confusables from developer gc, a package which I have also contributed to and has a much better feature set and far better performance


logo

@favware/unescape

Convert HTML entities to HTML characters, e.g. > converts to >.


Project Status

GitHub Codecov

Bundle Sizes

npm bundle size npm bundle size npm

Social Media and Donations

Join Discord server Twitter Follow Patreon Donate PayPal Donate


Easily unescape HTML entities in both the backend and the frontend

Key Features

  • Useable in NodeJS through package manager of choice
  • Typesafe
  • Bundled with Rollup for maximum size reduction (only 1kB minified + gzipped!), ES module support and browser support
  • Generated TypeScript declarations
  • Treeshakeable in Webpack

Install

Install with yarn or npm:

yarn add @favware/unescape

# npm install @favware/unescape

Usage

const { unescape, charSets } = require('@favware/unescape');
// import unescape, { charSets } from '@favware/unescape';

const text = '<div>unescaped</div>';

console.log(unescape('<div>abc</div>'));
console.log(unescape`<div>abc</div>`);
console.log(unescape`awesome text with some ${text} section`);

// Log the supported characters
console.log(charSets);

API Documentation

版本与发布记录

@favware/unescape 共发布 12 个版本,首次发布于 2019/05/18;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.3.2latest2020/01/236 年前
1.3.12019/11/097 年前
1.3.02019/10/217 年前
1.2.02019/10/217 年前
1.1.22019/10/137 年前
1.1.12019/10/137 年前

关于 @favware/unescape 的常见问题

@favware/unescape 是什么?

Convert HTML entities to HTML characters, e.g. > converts to >.注意:该包已被作者标记为弃用——Work on this package has stopped in favor of confusables (https://www.npmjs.com/package/confusables) from developer gc (https://github.com/gc), a package which I have also contributed to and has a much better feature set and far better performance

如何安装 @favware/unescape?

在项目目录运行 npm install @favware/unescape,或使用 pnpm add / yarn add / bun add。

@favware/unescape 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@favware/unescape 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@favware/unescape 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=10。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@favware/unescape 可以商用吗?

@favware/unescape 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@favware/unescape 的下载量有多少?

根据 npm 官方下载统计,@favware/unescape 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,573 次,日均约 86 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@favware/unescape 还在维护吗?

最新版本 1.3.2 发布于 2020/01/23(6 年前);至今共发布 12 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/05/18。作者已将其标记为弃用,新项目建议寻找替代方案。