Registry / devops / project-minifier

project-minifier

JSON →
library1.1.1jsnpmunverified

A Node.js CLI tool (v1.1.1) for scanning project structures and minifying file contents into JSON, optimized for AI chat token savings. It offers two scanning modes: full (with configurable exclusions) and selective (specific files/dirs). Outputs minified JSON files for structure and code. No active development cadence indicated; it's a niche utility for preparing codebases for LLM context windows. Compared to alternatives like repomix or code2prompt, it has fewer features but a simpler interactive workflow with .gitignore awareness.

npm install project-minifier
INSTALL
IMPORT
SIG · PROJECT-MINIFIER
P
project-minifier
devopsjavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

buildStructureJSON
✓ import { buildStructureJSON } from 'project-minifier'
✗ const buildStructureJSON = require('project-minifier').buildStructureJSON
Library is ESM-only; named import from package root.
default
✓ import projectMinifier from 'project-minifier'
✗ const projectMinifier = require('project-minifier')
Default export may be undefined; rely on named exports like buildStructureJSON, minifyCode.
minifyCode
✓ import { minifyCode } from 'project-minifier'
✗ const minifyCode = require('project-minifier').minifyCode
ESM named export; CommonJS require() will not work.

Shows programmatic usage of the two main functions to build project structure and minify code.

import { buildStructureJSON } from 'project-minifier' import { minifyCode } from 'project-minifier' // Build structure (mode 1: full scan, mode 2: selective) const structure = await buildStructureJSON(1) // structure is saved to 'project-structure.min.json' // Minify code using the generated structure await minifyCode() // outputs 'project-code.min.json' with selected files
Debug
Known issues
gotchaLibrary uses ESM only; CommonJS require() will fail with ERR_REQUIRE_ESM.
fix
Use import syntax or switch to dynamic import() if using CommonJS.
affects: >=1.0
breakingInteractive CLI prompts require process.stdin; may hang in non-interactive environments.
fix
Use programmatic API (buildStructureJSON, minifyCode) with predefined arguments or mock stdin.
affects: >=1.0
deprecatedDirect script execution via npx project-minifier may not work; use npm scripts as documented.
fix
Define scripts in package.json as shown in README.
affects: >=1.0
gotchaSelective scan behavior changed in v1.0: now requires array of dirs/files; older versions accepted string.
fix
Always pass arrays as arguments to buildStructureJSON.
affects: >=1.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Use import syntax or dynamic import()
TypeError: buildStructureJSON is not a function
Incorrect import or using default export.
fix
Use named import: import { buildStructureJSON } from 'project-minifier'
Error: Cannot find module 'glob'
Missing peer dependency 'glob'.
fix
npm install glob
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
globrequiredFile pattern matching for scanning directory tree
Agent activity
2 hits · last 30 days
node
2
Resources
project-minifier — npm install project-minifier · libregistry