{"id":15859,"library":"tinybundle","title":"tinybundle","description":"tinybundle is a minimalist command-line module bundler, currently at version 2.0.0, designed for simple bundling tasks without the complexity of modern bundlers like Webpack or Rollup. It distinguishes itself by eschewing a JavaScript API, relying solely on CLI arguments and a `tbdeps.json` configuration file. This file specifies a list of npm packages and local JavaScript files (prefixed with `!`), optionally allowing for pre-processing commands (prefixed with `?`) to be executed via `system` calls before bundling. The tool does not support traditional loaders, opting instead for this external command execution model. Its release cadence is not specified, but it targets users looking for an extremely lightweight, no-frills bundling solution where custom pre-processing can be scripted externally. It consolidates dependencies and local code into a single, minified output file.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install tinybundle","lang":"bash","label":"npm"},{"cmd":"yarn add tinybundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add tinybundle","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is designed exclusively for command-line usage and provides no JavaScript API or module exports for programmatic import.","wrong":"import tinybundle from 'tinybundle';","symbol":"tinybundle (default import)","correct":"N/A - tinybundle is a CLI-only tool."},{"note":"Attempts to import any symbols from 'tinybundle' will result in a module not found or undefined export error, as there are no exports.","wrong":"import { bundle } from 'tinybundle';","symbol":"tinybundle (named import)","correct":"N/A - tinybundle is a CLI-only tool."},{"note":"Use the `tinybundle` command directly from your terminal after global installation (`npm install -g tinybundle`) or via `npx tinybundle`.","wrong":"const tinybundle = require('tinybundle');","symbol":"tinybundle (CommonJS require)","correct":"N/A - tinybundle is a CLI-only tool."}],"quickstart":{"code":"mkdir my-bundle-project\ncd my-bundle-project\nnpm init -y\nnpm install jquery\necho '[\"jquery\", \"!index.js\"]' > tbdeps.json\necho 'console.log(\"Hello from index.js!\");' > index.js\nnpx tinybundle ./dist/bundle.js\ncat ./dist/bundle.js","lang":"javascript","description":"Demonstrates bundling a third-party npm package (jQuery) and a local JavaScript file into a single output file using the tinybundle CLI and `tbdeps.json` configuration. The output bundle's content is then displayed."},"warnings":[{"fix":"Interact with tinybundle only via the command line or through shell scripts.","message":"tinybundle is exclusively a CLI tool and offers no programmatic JavaScript API. It cannot be imported or used directly within Node.js applications.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Utilize the `?` prefix in `tbdeps.json` to execute external commands (e.g., Babel, Buble, TypeScript compiler) to transform files before bundling. Ensure the output of these commands is then included with `!`.","message":"The bundler does not support built-in loaders for languages like TypeScript, JSX, or CSS. All non-standard JavaScript must be pre-processed using external commands.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Carefully vet any commands executed via the `?` prefix. Avoid running untrusted commands or scripts with elevated privileges.","message":"Commands prefixed with `?` in `tbdeps.json` are executed as `system()` calls, which can have security implications or unexpected behavior depending on the execution environment and the commands used.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For projects requiring complex optimizations, code splitting, or handling of non-JavaScript assets (images, CSS), consider using more advanced bundlers like Webpack, Rollup, or esbuild.","message":"tinybundle outputs a single, minified JavaScript file and does not support advanced bundling features like code splitting, tree shaking, or separate asset handling.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run `npm install <package-name>` for all required npm packages before executing the `tinybundle` command.","message":"All npm packages specified in `tbdeps.json` must be pre-installed in your project's `node_modules` directory before running tinybundle.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Ensure all required npm packages are installed via `npm install <package-name>` in your project.","cause":"An npm package listed in `tbdeps.json` was not found in the `node_modules` directory.","error":"Error: Cannot find module 'some-package'"},{"fix":"Install tinybundle globally using `npm install -g tinybundle` or run it via `npx tinybundle`.","cause":"The `tinybundle` executable is not in your system's PATH or not globally installed.","error":"command not found: tinybundle"},{"fix":"Add a pre-processing step using the `?` prefix in `tbdeps.json` to transpile your code (e.g., `?npx buble input.jsx -o output.js`) before including the output with `!`.","cause":"tinybundle does not inherently understand non-standard JavaScript syntax (like JSX) or different module systems (ESM vs. CJS) without pre-processing.","error":"SyntaxError: Unexpected token '<' (for JSX) or 'SyntaxError: Cannot use import statement outside a module' (for ESM in CJS context)"}],"ecosystem":"npm"}