{"library":"lofi-bundler","title":"Lofi Bundler","description":"Lofi Bundler is a minimalist TypeScript utility designed for projects that prioritize simplicity and a zero-dependency build process, especially when targeting browser environments or when complex module loaders are unnecessary. It operates by walking through all specified TypeScript files within a project (explicitly excluding `node_modules` and other external folders) and concatenating their content into a single TypeScript bundle. This bundled file can then be fed into the standard TypeScript compiler (`tsc`) for final compilation, eliminating the need for more elaborate bundling solutions like Webpack, Rollup, or even Babel configurations. The package's current stable version is 1.0.1, suggesting a mature, feature-complete state with an infrequent release cadence focused on stability. Its primary differentiator lies in its 'lofi' philosophy: a bare-bones approach that avoids external dependencies and configuration overhead, making it ideal for small, self-contained utilities or libraries that need to run in both Node.js and the browser without introducing complex build chains or module resolution challenges inherent to different environments.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install lofi-bundler"],"cli":null},"imports":["import { traceConcat } from 'lofi-bundler';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"{\n  \"name\": \"my-lofi-project\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"prebuild:browser\": \"rm -f bundle.ts\",\n    \"build:browser\": \"lofi-bundler && tsc bundle.ts --target es5 --module commonjs --outFile dist/browser-bundle.js\",\n    \"postbuild:browser\": \"rm bundle.ts\" \n  },\n  \"config\": {\n    \"lofi-bundler\": {\n      \"entry\": \"src/index.ts\",\n      \"target\": \"bundle.ts\",\n      \"include\": \"src/utils/*.ts\" \n    }\n  },\n  \"devDependencies\": {\n    \"lofi-bundler\": \"^1.0.0\",\n    \"typescript\": \"^5.0.0\"\n  }\n}\n\n// src/index.ts\nexport function sayHello(name: string): string {\n  return `Hello from Lofi Bundler, ${name}!`;\n}\n\n// src/utils/math.ts\nexport function add(a: number, b: number): number {\n  return a + b;\n}\n\n// To run:\n// 1. Save the above package.json\n// 2. Create src/index.ts and src/utils/math.ts with the content above.\n// 3. Run `npm install` or `yarn install`.\n// 4. Run `npm run build:browser` or `yarn build:browser`.\n// This will generate `dist/browser-bundle.js`.\n\n// Example of programmatic usage (optional, does not require package.json config)\n// import { traceConcat } from 'lofi-bundler';\n// import * as fs from 'fs';\n\n// async function generateBundleApi() {\n//   const entryFilePath = 'src/index.ts';\n//   const bundledSource = await traceConcat(entryFilePath);\n//   fs.writeFileSync('bundle-via-api.ts', bundledSource);\n//   console.log('Bundle generated via API to bundle-via-api.ts');\n// }\n// generateBundleApi();","lang":"typescript","description":"Demonstrates how to configure and run `lofi-bundler` via CLI in `package.json` scripts, including the subsequent `tsc` step for browser compatibility, and also shows programmatic API usage for direct integration.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}