The `iso-constants` package provides Node.js's `process.constants` values in a way that is usable across both Node.js and browser environments. It aims to offer a consistent set of system-level constants, such as `RTLD_LAZY` or `UV_THREADPOOL_SIZE`, regardless of the execution context. Currently at version `0.1.2`, the library maintains a generally low release cadence, primarily issuing patch fixes, indicating a stable and focused scope rather than rapid feature development. A key differentiator is its automatic constant update mechanism, which runs during `npm install` to ensure the most current constants are available. This approach enables developers to write isomorphic code that relies on these specific constants without needing conditional logic for different runtimes, simplifying cross-environment development.
npm install iso-constantsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and access various Node.js `process.constants`, such as `RTLD_LAZY` and `UV_THREADPOOL_SIZE`, using `iso-constants` in an isomorphic way.
Pin exact package versions in your `package.json` and use `npm ci` or `yarn install --frozen-lockfile` to ensure reproducible builds from lock files.
Review changelogs carefully for each update and test thoroughly, especially when upgrading between minor versions.
Change the import statement to `import constants from 'iso-constants';` in ESM files, or ensure your file is treated as CommonJS (e.g., by using `.cjs` extension or configuring `"type": "commonjs"` in your `package.json`).
Verify `iso-constants` is correctly installed by running `npm reinstall iso-constants` to re-execute the `postinstall` script. Check for any network errors or permission issues during the installation process.
No dependency data recorded yet.