Registry / devops / bdr
library1.7.0jsnpmunverified

BDR (BunDleR) is a JavaScript/TypeScript bundler inspired by `bili` and `poi`, originally designed for bundling, transforming, and developing JavaScript projects. It aimed to provide a lightweight alternative for building modern applications, leveraging TypeScript. Originally released with features for source code transformation and development server capabilities, its latest version is 1.7.0, released in September 2019. The project is currently abandoned, with its GitHub repository archived, indicating no further development or maintenance. Users should be aware that it lacks support for newer JavaScript features, security updates, and compatibility with recent Node.js and TypeScript versions, making it unsuitable for new projects or active development.

npm install bdr
INSTALL
IMPORT
SIG · BDR
B
bdr
devopsjavascriptv1.7.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

build
import { build } from 'bdr'
const { build } = require('bdr')
The primary function for programmatically triggering a build. While ESM import is shown, CommonJS 'require' was also common for Node.js projects at the time of its last update.
CLI Tool
npx bdr build [entrypoint] --outDir dist
bdr build // Requires global install which is not recommended.
BDR was primarily used via its command-line interface. 'npx' ensures using the locally installed version without global installation.
Configuration
// bdr.config.js module.exports = { entry: 'src/index.js', output: { dir: 'dist' } };
import config from './bdr.config.js' // ES module config files (.mjs) were less common at the time, and direct import of configuration files is not how bundlers typically consume them.
Configuration was typically provided via a 'bdr.config.js' file in the project root, exported as a CommonJS module.

Demonstrates how to programmatically use BDR's `build` function to bundle a simple JavaScript file, including temporary file setup and cleanup for execution.

import { build } from 'bdr'; import path from 'path'; import fs from 'fs'; // Create a dummy source file for demonstration const entryContent = ` console.log('Hello from BDR!'); export const greeting = 'BDR says hi!'; `; const srcDir = path.resolve(__dirname, 'temp_bdr_src'); const entryPath = path.resolve(srcDir, 'main.js'); const distPath = path.resolve(__dirname, 'temp_bdr_dist'); fs.mkdirSync(path.dirname(entryPath), { recursive: true }); fs.writeFileSync(entryPath, entryContent); async function runBuild() { try { console.log('Starting BDR build...'); await build({ entry: entryPath, output: { dir: distPath, format: 'cjs', // 'cjs' or 'esm' fileName: 'bundle.js' } }); console.log(`Build complete! Output in ${distPath}`); const bundleContent = fs.readFileSync(path.join(distPath, 'bundle.js'), 'utf-8'); console.log('Bundle content preview:\n', bundleContent.substring(0, Math.min(bundleContent.length, 150)) + (bundleContent.length > 150 ? '...' : '')); } catch (error) { console.error('BDR build failed:', error); } finally { // Clean up temporary files fs.rmSync(srcDir, { recursive: true, force: true }); fs.rmSync(distPath, { recursive: true, force: true }); console.log('Cleaned up temporary files.'); } } runBuild();
bdr --version
Debug
Known issues
breakingThe 'bdr' project is abandoned and its GitHub repository is archived. This means there will be no further updates, bug fixes, or security patches, making it unsafe for new projects or critical applications.
fix
Migrate to an actively maintained and supported bundler such as Rollup, esbuild, Vite (which leverages Rollup/esbuild), or Webpack.
affects: >=1.0.0
breakingDue to its abandonment in 2019, 'bdr' does not support modern JavaScript syntax (e.g., optional chaining, nullish coalescing), recent TypeScript features, or newer Node.js versions.
fix
Projects requiring modern language features or recent runtime compatibility must use an alternative, maintained bundler to avoid parsing errors or unexpected behavior.
affects: >=1.0.0
gotchaThe peer dependency on 'typescript' is locked to '^3.1.3'. Using newer TypeScript versions (e.g., 4.x or 5.x) will likely lead to compilation errors or incompatibility issues due to changes in the TypeScript API or syntax support.
fix
If 'bdr' must be used for legacy projects, ensure 'typescript@^3.1.3' is installed as a peer dependency. Consider migration as the long-term, recommended solution.
affects: >=1.0.0
gotchaInternal and transitive dependencies used by 'bdr' are likely outdated, posing potential security vulnerabilities (CVEs) and compatibility issues with current npm ecosystems. Using this package introduces significant supply chain risks.
fix
Thoroughly audit any existing project using 'bdr' for transitive vulnerabilities. The most effective mitigation is to migrate to a current bundler with active security maintenance.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: build is not a function
Incorrect import statement, or 'build' function is not exposed as expected when attempting to use CommonJS `require` or an outdated version of the package.
fix
Ensure you are using the correct ESM import: `import { build } from 'bdr'`. If using CommonJS, verify the module target in your `tsconfig.json` or try `const bdr = require('bdr'); bdr.build(...)` if it's a default export with properties.
Error: Cannot find module 'typescript' or Module not found: Error: Can't resolve 'typescript'
'typescript' is a peer dependency of 'bdr' but was not installed in the project's `node_modules`.
fix
Install the specific TypeScript version required by 'bdr': `npm install typescript@^3.1.3` or `yarn add typescript@^3.1.3`.
bdr: command not found
The `bdr` CLI tool is not globally installed on your system's PATH, or it is not available in the local project's `node_modules/.bin` directory.
fix
Use `npx bdr` to execute the local installation of the CLI, or ensure 'bdr' is listed in your project's `package.json` scripts (e.g., `"build": "bdr build"`) and run via `npm run build`.
SyntaxError: Unexpected token '?' / Unexpected private field
Attempting to bundle source code that uses modern JavaScript syntax (e.g., optional chaining `?.`, nullish coalescing `??`, private class fields `#field`) which 'bdr's outdated parser cannot understand.
fix
This issue is fundamental to 'bdr' being an abandoned project with an outdated parser. It cannot be fixed within 'bdr'. The only resolution is to migrate your project to a current bundler that supports these modern language features.
Upgrade
Version history
1.7.0latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency for TypeScript compilation and type checking during development and build processes, specifically `^3.1.3`.
Agent activity
4 hits · last 30 days
node
4
Resources
bdr — npm install bdr · libregistry