Installations
npm install @zkochan/remark-toc
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=0.10.0
Node Version
5.11.0
NPM Version
3.8.1
Score
70.9
Supply Chain
98.3
Quality
74.9
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
2,732
Last Day
2
Last Week
7
Last Month
34
Last Year
388
GitHub Statistics
430 Stars
198 Commits
33 Forks
13 Watching
1 Branches
18 Contributors
Bundle Size
12.68 kB
Minified
5.03 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.2.0
Package Id
@zkochan/remark-toc@0.2.0
Size
6.21 kB
NPM Version
3.8.1
Node Version
5.11.0
Total Downloads
Cumulative downloads
Total Downloads
2,732
Last day
0%
2
Compared to previous day
Last week
75%
7
Compared to previous week
Last month
100%
34
Compared to previous month
Last year
-9.3%
388
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
remark-toc
Generate a Table of Contents in remark.
Installation
npm:
1npm install remark-toc
remark-toc is also available as an AMD, CommonJS, and globals module, uncompressed and compressed.
Usage
Dependencies:
1var remark = require('remark'); 2var toc = require('remark-toc');
Process:
1var doc = remark().use(toc).process([ 2 '# Alpha', 3 '', 4 '## Table of Contents', 5 '', 6 '## Bravo', 7 '', 8 '### Charlie', 9 '', 10 '## Delta', 11 '' 12].join('\n'));
Yields:
1# Alpha 2 3## Table of Contents 4 5- [Bravo](#bravo) 6 7 - [Charlie](#charlie) 8 9- [Delta](#delta) 10 11## Bravo 12 13### Charlie 14 15## Delta
API
remark.use(toc[, options])
Add a Table of Contents to a Markdown document.
-
Looks for the first heading containing
"Table of Contents"
,"toc"
, ortable-of-contents
(case insensitive, supports alt/title attributes for links and images too); -
Removes all following contents until an equal or higher heading is found;
-
Inserts a list representation of the hierarchy of following headings;
-
Adds links to following headings, using the same slugs as GitHub.
Options (Object
, optional):
-
slug
— Passed toremark-slug
; -
heading
(string?
, default:"toc|table[ -]of[ -]contents?"
) — Heading to look for, wrapped innew RegExp('^(' + value + ')$', 'i');
; -
maxDepth
(number?
, default:6
) — Maximum heading depth to include in the table of contents, This is inclusive, thus, when set to3
, level three headings, are included (those with three hashes,###
); -
tight
(boolean?
, default:false
) — Whether to compile list-items tightly.
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/remarkjs/.github/security.md:1
- Info: Found linked content: github.com/remarkjs/.github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/remarkjs/.github/security.md:1
- Info: Found text in security policy: github.com/remarkjs/.github/security.md:1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/30 approved changesets -- score normalized to 0
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
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/remarkjs/remark-toc/bb.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/remarkjs/remark-toc/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/remarkjs/remark-toc/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/remarkjs/remark-toc/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:15
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
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 1 are checked with a SAST tool
Score
4.1
/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