{"library":"os-browserify","title":"OS Module for Browsers (Browserify Shim)","description":"The `os-browserify` package provides a browser-compatible shim for Node.js's native `os` module, allowing CommonJS `require('os')` calls to function in web browsers when bundled with Browserify. Its current stable version is 0.3.0, last published in April 2017, indicating an effectively abandoned release cadence. This package serves as a direct polyfill for many `os` functions, adapting them to a browser environment or providing sensible defaults or stubs where native browser APIs cannot replicate Node.js functionality. It differentiates itself by tightly integrating with the Browserify bundling ecosystem, automatically replacing the Node.js `os` core module during the bundling process, making it transparent to applications originally written for Node.js.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install os-browserify"],"cli":null},"imports":["const os = require('os');","console.log(os.platform());"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"/* file: main.js */\nconst os = require('os');\n\nconsole.log('--- os-browserify demonstration ---');\nconsole.log('OS Type:', os.type());\nconsole.log('OS Platform:', os.platform());\nconsole.log('OS Release:', os.release());\nconsole.log('OS Arch:', os.arch());\nconsole.log('OS Uptime (seconds):', os.uptime());\nconsole.log('OS Total Memory (bytes):', os.totalmem());\nconsole.log('OS Free Memory (bytes):', os.freemem());\nconsole.log('OS CPU Count:', os.cpus()?.length || 'N/A');\nconsole.log('OS Network Interfaces:', os.networkInterfaces());\n\n/* To run this: */\n/* 1. npm init -y && npm install os-browserify browserify */\n/* 2. browserify main.js -o bundle.js */\n/* 3. Create an HTML file (e.g., index.html): */\n/*    <script src=\"bundle.js\"></script> */\n/* 4. Open index.html in a browser and check console. */","lang":"javascript","description":"Demonstrates how to use various Node.js `os` module functions in a browser environment by bundling with Browserify.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}