@datalackey/update-markdown-toc 1.1.1 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/bin/update-markdown-toc.js +3 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
- [Recursively Traversing a Folder Hierarchy to Process all files vs. Single File Processing](#recursively-traversing-a-folder-hierarchy-to-process-all-files-vs-single-file-processing)
|
|
27
27
|
- [Single-File Processing (Strict Mode)](#single-file-processing-strict-mode)
|
|
28
28
|
- [Recursive Folder Traversal (Lenient Mode)](#recursive-folder-traversal-lenient-mode)
|
|
29
|
+
- [Design Goals and Philosophy](#design-goals-and-philosophy)
|
|
29
30
|
- [Guidelines For Project Contributors](#guidelines-for-project-contributors)
|
|
31
|
+
- [Known limitations](#known-limitations)
|
|
30
32
|
<!-- TOC:END -->
|
|
31
33
|
|
|
32
34
|
## Introduction
|
|
@@ -263,3 +265,9 @@ The intended workflow is:
|
|
|
263
265
|
|
|
264
266
|
Contributors to the project should consult [this document](GUIDELINES-FOR-PROJECT-CONTRIBUTORS.md)
|
|
265
267
|
|
|
268
|
+
|
|
269
|
+
## Known limitations
|
|
270
|
+
|
|
271
|
+
- node_modules is excluded from recursive traversal: when using `--recursive` the tool will skip any directory
|
|
272
|
+
named `node_modules` and its contents. This prevents accidental processing or modification of third-party files.
|
|
273
|
+
This exclusion is currently hard-coded and not configurable via command-line flags or configuration files.
|
|
@@ -51,6 +51,9 @@ function collectMarkdownFiles(dir) {
|
|
|
51
51
|
const full = path.join(dir, entry.name);
|
|
52
52
|
|
|
53
53
|
if (entry.isDirectory()) {
|
|
54
|
+
// Exclude node_modules from recursive traversal to avoid processing third-party files
|
|
55
|
+
if (entry.name === 'node_modules') continue;
|
|
56
|
+
|
|
54
57
|
results.push(...collectMarkdownFiles(full));
|
|
55
58
|
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
56
59
|
results.push(full);
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalackey/update-markdown-toc",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Auto-generate Table of Contents for a Markdown file (or files, recursively from a top level folder)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"private": false,
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "bash scripts/run-all-tests.sh"
|
|
9
|
+
"test": "bash scripts/run-all-tests.sh",
|
|
10
|
+
"prepack": "npm run test"
|
|
10
11
|
},
|
|
11
12
|
"bin": {
|
|
12
13
|
"update-markdown-toc": "./bin/update-markdown-toc.js"
|