@datalackey/update-markdown-toc 1.1.1 → 1.1.3

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 CHANGED
@@ -27,6 +27,7 @@
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
29
  - [Guidelines For Project Contributors](#guidelines-for-project-contributors)
30
+ - [Known limitations](#known-limitations)
30
31
  <!-- TOC:END -->
31
32
 
32
33
  ## Introduction
@@ -263,3 +264,9 @@ The intended workflow is:
263
264
 
264
265
  Contributors to the project should consult [this document](GUIDELINES-FOR-PROJECT-CONTRIBUTORS.md)
265
266
 
267
+
268
+ ## Known limitations
269
+
270
+ - node_modules is excluded from recursive traversal: when using `--recursive` the tool will skip any directory
271
+ named `node_modules` and its contents. This prevents accidental processing or modification of third-party files.
272
+ 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.1",
3
+ "version": "1.1.3",
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"