{"id":41795,"library":"project-minifier","title":"project-minifier","description":"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.","status":"active","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/Skifak/project-minifier","tags":["javascript","structured-data","file-parser","minifier","minifi-json","cli","code-minification","ai-chat","code-preparation"],"install":[{"cmd":"npm install project-minifier","lang":"bash","label":"npm"},{"cmd":"yarn add project-minifier","lang":"bash","label":"yarn"},{"cmd":"pnpm add project-minifier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"File pattern matching for scanning directory tree","package":"glob","optional":false}],"imports":[{"note":"Library is ESM-only; named import from package root.","wrong":"const buildStructureJSON = require('project-minifier').buildStructureJSON","symbol":"buildStructureJSON","correct":"import { buildStructureJSON } from 'project-minifier'"},{"note":"Default export may be undefined; rely on named exports like buildStructureJSON, minifyCode.","wrong":"const projectMinifier = require('project-minifier')","symbol":"default","correct":"import projectMinifier from 'project-minifier'"},{"note":"ESM named export; CommonJS require() will not work.","wrong":"const minifyCode = require('project-minifier').minifyCode","symbol":"minifyCode","correct":"import { minifyCode } from 'project-minifier'"}],"quickstart":{"code":"import { buildStructureJSON } from 'project-minifier'\nimport { minifyCode } from 'project-minifier'\n\n// Build structure (mode 1: full scan, mode 2: selective)\nconst structure = await buildStructureJSON(1)\n// structure is saved to 'project-structure.min.json'\n\n// Minify code using the generated structure\nawait minifyCode()\n// outputs 'project-code.min.json' with selected files","lang":"typescript","description":"Shows programmatic usage of the two main functions to build project structure and minify code."},"warnings":[{"fix":"Use import syntax or switch to dynamic import() if using CommonJS.","message":"Library uses ESM only; CommonJS require() will fail with ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use programmatic API (buildStructureJSON, minifyCode) with predefined arguments or mock stdin.","message":"Interactive CLI prompts require process.stdin; may hang in non-interactive environments.","severity":"breaking","affected_versions":">=1.0"},{"fix":"Define scripts in package.json as shown in README.","message":"Direct script execution via npx project-minifier may not work; use npm scripts as documented.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Always pass arrays as arguments to buildStructureJSON.","message":"Selective scan behavior changed in v1.0: now requires array of dirs/files; older versions accepted string.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"search_vec":"'activ':47 'ai':21,98 'ai-chat':97 'altern':65 'awar':81 'cadenc':49 'chat':22,99 'cli':6,93 'code':45,95,101 'code-minif':94 'code-prepar':100 'code2prompt':69 'codebas':58 'compar':63 'configur':32 'content':16 'context':61 'data':85 'develop':48 'exclus':33 'featur':73 'fewer':72 'file':15,41,87 'file-pars':86 'files/dirs':37 'full':30 'gitignor':80 'indic':50 'interact':77 'javascript':82 'json':18,40,92 'like':66 'llm':60 'minif':96 'minifi':3,14,39,89,91 'minifi-json':90 'mode':29 'nich':54 'node.js':5 'offer':26 'optim':19 'output':38 'parser':88 'prepar':57,102 'project':2,11 'project-minifi':1 'repomix':67 'save':24 'scan':10,28 'select':35 'simpler':76 'specif':36 'structur':12,43,84 'structured-data':83 'token':23 'tool':7 'two':27 'util':55 'v1.1.1':8 'window':62 'workflow':78","created_at":"2026-06-04T18:54:08.856831+00:00","updated_at":"2026-06-04T18:54:08.856831+00:00","problems":[{"fix":"Use import syntax or dynamic import()","cause":"Using require() on an ESM-only package.","error":"ERR_REQUIRE_ESM"},{"fix":"Use named import: import { buildStructureJSON } from 'project-minifier'","cause":"Incorrect import or using default export.","error":"TypeError: buildStructureJSON is not a function"},{"fix":"npm install glob","cause":"Missing peer dependency 'glob'.","error":"Error: Cannot find module 'glob'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Skifak/project-minifier#readme","github":"https://github.com/Skifak/project-minifier","docs":null,"changelog":null,"pypi":null,"npm":"project-minifier","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}