obug is a lightweight JavaScript debugging utility, forked from the popular `debug` package, specifically engineered for modern JavaScript environments. It offers comprehensive TypeScript support and native ES Module (ESM) compatibility, making it suitable for contemporary Node.js applications and browser environments (ES2015+). The current stable version is 2.1.1, with recent updates focusing on performance enhancements and customizable features. Unlike its predecessor `debug`, obug prioritizes a minimal footprint (7.7 kB package size, 1.4 KB minified + gzipped for browsers) and zero external dependencies. Key differentiators include full TypeScript type definitions, native ESM support from the ground up, and an API optimized for modern runtimes. Version 2 introduced a significant rewrite, refactoring API imports and usage for improved modularity, customization, and further reduced package size compared to v1, which aimed for `debug` compatibility but dropped older runtime support.
npm install obugVerified import paths — ran on the pinned version, not inferred.
Demonstrates `obug` installation, creating debuggers, enabling/disabling namespaces, and using sub-namespaces.
Update all import statements to use named exports (e.g., `import { createDebug } from 'obug'`) instead of relying on a default export or a CommonJS-style `require('obug')` that returns a function.Ensure your project's target environment supports ES2015+ features (e.g., modern browsers, Node.js 14+). If targeting older runtimes, consider using the original `debug` package or transpiling your code.
Prefer `import ... from 'obug'` syntax. If using CommonJS, ensure your build setup correctly handles ESM imports or configure Node.js with `--experimental-loader esm` (though named imports are still the preferred way).
Use the named export `createDebug` explicitly: `import { createDebug } from 'obug'; const debug = createDebug('my-namespace');`Ensure you are using `import { createDebug } from 'obug';` for ESM, and verify that your environment is properly configured for ESM. If strictly in CJS, you may need a bundler to resolve the ESM module correctly.Convert your module to use ES Module syntax (`import`/`export`). `obug` is built for ESM, and mixing CJS patterns can lead to errors.
No dependency data recorded yet.