Registry / devops / character-entities-legacy

character-entities-legacy

JSON →
library3.0.0jsnpmunverified

A list of legacy HTML named character references that do not require a trailing semicolon (e.g., &copy works for ©). This package provides a single exported array of entity names (without the ampersand or semicolon) that historically are allowed without the semicolon in HTML. Version 3.0.0 is ESM-only, fully typed with TypeScript, and requires Node.js 12.20+, 14.14+, or 16.0+. It is a focused utility for HTML parsers and minifiers; use parse-entities or stringify-entities for broader entity handling.

npm install character-entities-legacy
INSTALL
IMPORT
SIG · CHARACTER-ENTITIES
C
character-entities-legacy
devopsjavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

characterEntitiesLegacy
import { characterEntitiesLegacy } from 'character-entities-legacy'
const characterEntitiesLegacy = require('character-entities-legacy')
ESM-only since v3; CommonJS require will fail. The array is case-sensitive; entity names are without '&' or ';'.
(default export)
import { characterEntitiesLegacy } from 'character-entities-legacy'
import characterEntitiesLegacy from 'character-entities-legacy'
There is no default export; only a named export is available.
TypeScript usage
import { characterEntitiesLegacy } from 'character-entities-legacy'
import { characterEntitiesLegacy } from 'character-entities-legacy' with types assertion
Types are bundled; no additional type package needed.

Shows how to import and use the legacy entity names array, checking membership and array properties.

import { characterEntitiesLegacy } from 'character-entities-legacy' console.log(characterEntitiesLegacy.includes('copy')) // true console.log(characterEntitiesLegacy.includes('frac34')) // true console.log(characterEntitiesLegacy.includes('sup1')) // true console.log(Array.isArray(characterEntitiesLegacy)) // true console.log(characterEntitiesLegacy.length) // number of entities
Debug
Known issues
breakingPackage is ESM-only starting from version 3.0.0. CommonJS require() will throw.
fix
Use ESM import or upgrade to Node.js 12+ and use 'import' syntax.
affects: >=3.0.0
gotchaThe entity names are case-sensitive and do not include the leading '&' or trailing ';'.
fix
Use lowercase strings without punctuation (e.g., 'copy', not '&copy' or '©').
affects: all
gotchaOnly legacy entities that do not require a semicolon are included; modern entities are in the companion package character-entities.
fix
Use character-entities for full list, or parse-entities for parsing.
affects: all
Errors
Common errors & fixes
require is not defined in ES module scope
Trying to use require() in an ESM-only package.
fix
Change to import { characterEntitiesLegacy } from 'character-entities-legacy' and ensure package.json has 'type': 'module'.
Cannot find module 'character-entities-legacy'
Package not installed or import path incorrect.
fix
Run 'npm install character-entities-legacy' and use correct import syntax.
characterEntitiesLegacy.includes is not a function
Importing default instead of named export, or using wrong variable.
fix
Use 'import { characterEntitiesLegacy } from 'character-entities-legacy'' (named export).
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
character-entities-legacy — npm install character-entities-legacy · libregistry