lib0 is a monorepo offering a comprehensive collection of isomorphic utility functions designed for both Node.js and browser environments. These utilities cover fundamental programming needs such as array manipulation, efficient binary encoding/decoding, cryptographic operations, assertions, and more. The package is currently at version `0.2.117` on npm, representing its stable release line. However, an active development branch is progressing towards `v1.0.0`, with frequent release candidates (e.g., `v1.0.0-rc.12`) introducing significant architectural changes, particularly within its `delta` and `schema` modules. It supports both CommonJS and ESM module formats. Its primary differentiator lies in providing a robust, performance-optimized, and isomorphic toolkit, minimizing the need for environment-specific code paths and enabling effective dead code elimination by bundlers. The project appears to have an active development cadence, pushing out release candidates regularly.
npm install lib0Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of `lib0/error` for assertions, `lib0/encoding` and `lib0/decoding` for binary data manipulation, and `lib0/array` for common array utilities.
Consult the `v1.0.0` changelog and specific module documentation for migration guides. Extensive refactoring may be required for `delta` and `schema` module consumers.
Upgrade your Node.js environment to version 16 or newer to ensure compatibility. This is an explicit engine requirement in the package metadata.
Ensure your project's `package.json` `type` field and bundler configuration (e.g., Webpack, Rollup) are correctly set up for dual CJS/ESM compatibility, especially when consuming subpath imports. Prefer `import` statements over `require` in modern TypeScript/ESM projects.
Change your import statement from `const { someFunc } = require('lib0/module');` to `import { someFunc } from 'lib0/module';`. Ensure your project's `tsconfig.json` (if using TypeScript) and bundler are configured for ESM output where appropriate.Verify your bundler (e.g., Webpack, Rollup, esbuild) configuration has `esModuleInterop: true` in TypeScript, and that tree-shaking rules are not overly aggressive or misconfigured for `lib0`'s subpath exports. Ensure direct named imports (`import { assert } from 'lib0/error'`) are used rather than default imports or namespace imports if only specific functions are needed.No dependency data recorded yet.