The `os-shim` package provides a compatibility layer for the native Node.js `os` module API, backporting features that became standard in Node.js 0.10.x to much older versions, specifically 0.4.x and 0.8.x. It shims functions like `os.tmpdir()`, `os.endianness()`, `os.platform()`, `os.arch()`, and the `os.EOL` constant, which were either missing or had differing behaviors in those legacy environments. The package is currently at version 0.1.3 (last updated circa 2013) and has an abandoned release cadence, meaning it is no longer actively maintained. Its primary differentiator was enabling consistent `os` module usage across deeply antiquated Node.js runtimes where standard `os` module features were inconsistent or absent.
npm install os-shimVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use the `os-shim` package to access various operating system properties like temporary directory, endianness, EOL, platform, and architecture, highlighting its role in legacy environments.
Upgrade to a currently supported Node.js version. If legacy code truly requires specific `os` module behavior, backport the minimal polyfill directly or rewrite the affected logic to use modern APIs.
Remove `os-shim` from your project and directly use the native `os` module provided by modern Node.js runtimes. For example, replace `require('os-shim')` with `require('os')`.Do not introduce this package into new projects. For existing projects, evaluate its necessity and consider migrating to modern Node.js APIs or custom, targeted polyfills if absolutely necessary for ancient Node.js targets.
This shim does not provide newer `os` module APIs (e.g., `os.cpus()`, `os.networkInterfaces()` in their modern forms). Use the native `os` module for comprehensive or modern API access, or implement a specific polyfill if truly targeting ancient Node.js environments.
Do not attempt to use `os-shim` in a browser. For browser-compatible OS-like functionality, use dedicated browser utility libraries or web APIs.
No dependency data recorded yet.