small, safe, and great commonmark (optionally gfm) compliant markdown parser
Installations
npm install micromark-util-encode
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
23.1.0
NPM Version
10.9.0
Score
99.9
Supply Chain
98.9
Quality
76.5
Maintenance
100
Vulnerability
100
License
Releases
micromark-util-subtokenize@2.0.3
Published on 19 Nov 2024
4.0.1
Published on 12 Nov 2024
micromark-core-commonmark@2.0.1
Published on 23 Apr 2024
micromark-util-subtokenize@2.0.1
Published on 16 Apr 2024
micromark-util-character@2.1.0
Published on 28 Jan 2024
micromark-util-decode-numeric-character-reference@2.0.1
Published on 27 Oct 2023
Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
498,144,339
Last Day
1,417,493
Last Week
6,536,730
Last Month
28,339,547
Last Year
295,226,303
GitHub Statistics
1,877 Stars
646 Commits
67 Forks
15 Watching
2 Branches
27 Contributors
Bundle Size
328.00 B
Minified
231.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
2.0.1
Package Id
micromark-util-encode@2.0.1
Unpacked Size
7.78 kB
Size
3.23 kB
File Count
6
NPM Version
10.9.0
Node Version
23.1.0
Publised On
12 Nov 2024
Total Downloads
Cumulative downloads
Total Downloads
498,144,339
Last day
-4%
1,417,493
Compared to previous day
Last week
-11.8%
6,536,730
Compared to previous week
Last month
7.6%
28,339,547
Compared to previous month
Last year
108%
295,226,303
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
micromark-util-encode
micromark utility to encode dangerous html characters.
Contents
- What is this?
- When should I use this?
- Install
- Use
- API
- Types
- Compatibility
- Security
- Contribute
- License
What is this?
This package exposes an algorithm to make text safe for embedding in HTML.
When should I use this?
This package might be useful when you are making your own micromark extensions.
Install
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install micromark-util-encode
In Deno with esm.sh
:
1import {encode} from 'https://esm.sh/micromark-util-encode@1'
In browsers with esm.sh
:
1<script type="module"> 2 import {encode} from 'https://esm.sh/micromark-util-encode@1?bundle' 3</script>
Use
1import {encode} from 'micromark-util-encode' 2 3encode('<3') // '<3'
API
This module exports the identifier encode
.
There is no default export.
encode(value)
Encode only the dangerous HTML characters.
This ensures that certain characters which have special meaning in HTML are
dealt with.
Technically, we can skip >
and "
in many cases, but CM includes them.
Parameters
value
(string
) — value to encode
Returns
Encoded value (string
).
Types
This package is fully typed with TypeScript. It exports no additional types.
Compatibility
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
micromark-util-encode@2
, compatible with Node.js 16.
This package works with micromark@3
.
Security
This package is safe.
See security.md
in micromark/.github
for how to
submit a security report.
Contribute
See contributing.md
in micromark/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.
License
MIT © Titus Wormer
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/micromark/.github/security.md:1
- Info: Found linked content: github.com/micromark/.github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/micromark/.github/security.md:1
- Info: Found text in security policy: github.com/micromark/.github/security.md:1
Reason
8 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 9
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/bb.yml:1
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:5: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/bb.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:6: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/micromark/micromark/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:11
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:17
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:43
- Info: 0 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 3 npmCommand dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
5
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More