Socket
Socket
Sign inDemoInstall

character-entities

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

7

index.js

@@ -1,2 +0,7 @@

export var characterEntities = {
/**
* Map of named character references.
*
* @type {Record<string, string>}
*/
export const characterEntities = {
AEli: 'Æ',

@@ -3,0 +8,0 @@ AElig: 'Æ',

37

package.json
{
"name": "character-entities",
"version": "2.0.0",
"description": "HTML character entity information",
"version": "2.0.1",
"description": "Map of named character references",
"license": "MIT",

@@ -35,22 +35,22 @@ "keywords": [

"@types/tape": "^4.0.0",
"bail": "^1.0.0",
"bail": "^2.0.0",
"c8": "^7.0.0",
"concat-stream": "^2.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.38.0"
"xo": "^0.46.0"
},
"scripts": {
"prepublishOnly": "npm run build",
"generate": "node build",
"prepublishOnly": "npm run build && npm run format",
"build": "rimraf \"*.d.ts\" && tsc && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"prebuild": "rimraf \"*.d.ts\"",
"build": "tsc",
"test-api": "node test",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js",
"test": "npm run generate && npm run format && npm run build && npm run test-coverage"
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
"test": "npm run generate && npm run build && npm run format && npm run test-coverage"
},

@@ -66,8 +66,3 @@ "prettier": {

"xo": {
"prettier": true,
"rules": {
"import/no-mutable-exports": "off",
"no-var": "off",
"prefer-arrow-callback": "off"
}
"prettier": true
},

@@ -78,3 +73,9 @@ "remarkConfig": {

]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true,
"ignoreCatch": true
}
}

@@ -8,11 +8,36 @@ # character-entities

HTML character entity information.
Map of named character references.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [characterEntities](#characterentities)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This is a map of named character references in HTML (latest) to the characters
they represent.
## When should I use this?
Maybe when you’re writing an HTML parser or minifier, but otherwise probably
never!
Even then, it might be better to use [`parse-entities`][parse-entities] or
[`stringify-entities`][stringify-entities].
## Install
This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
instead of `require`d.
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
[npm][]:
```sh

@@ -22,7 +47,18 @@ npm install character-entities

In Deno with [Skypack][]:
```js
import {characterEntities} from 'https://cdn.skypack.dev/character-entities@2?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import {characterEntities} from 'https://cdn.skypack.dev/character-entities@2?min'
</script>
```
## Use
This package exports the following identifiers: `characterEntities`.
There is no default export.
```js

@@ -38,21 +74,42 @@ import {characterEntities} from 'character-entities'

This package exports the following identifiers: `characterEntities`.
There is no default export.
### characterEntities
Mapping between (case-sensitive) character entity names to replacements.
See [`html.spec.whatwg.org`][html] for more info.
## Support
## Types
See [`html.spec.whatwg.org`][html].
This package is fully typed with [TypeScript][].
## Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.
## Security
This package is safe.
## Related
* [`character-entities-html4`](https://github.com/wooorm/character-entities-html4)
— HTML 4 character entity info
* [`wooorm/parse-entities`](https://github.com/wooorm/parse-entities)
— parse (decode) character references
* [`wooorm/stringify-entities`](https://github.com/wooorm/stringify-entities)
— serialize (encode) character references
* [`wooorm/character-entities-html4`](https://github.com/wooorm/character-entities-html4)
— info on named character references in HTML 4
* [`character-reference-invalid`](https://github.com/wooorm/character-reference-invalid)
— info on invalid numeric character references
* [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy)
— Legacy character entity info
* [`parse-entities`](https://github.com/wooorm/parse-entities)
— Parse HTML character references
* [`stringify-entities`](https://github.com/wooorm/stringify-entities)
— Stringify HTML character references
— info on legacy named character references
## Contribute
Yes please!
See [How to Contribute to Open Source][contribute].
## License

@@ -68,5 +125,5 @@

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/longest-streak.svg
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities.svg
[coverage]: https://codecov.io/github/wooorm/longest-streak
[coverage]: https://codecov.io/github/wooorm/character-entities

@@ -83,2 +140,4 @@ [downloads-badge]: https://img.shields.io/npm/dm/character-entities.svg

[skypack]: https://www.skypack.dev
[license]: license

@@ -88,2 +147,12 @@

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[contribute]: https://opensource.guide/how-to-contribute/
[parse-entities]: https://github.com/wooorm/parse-entities
[stringify-entities]: https://github.com/wooorm/stringify-entities
[html]: https://html.spec.whatwg.org/multipage/syntax.html#named-character-references

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc