This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
chrome-os with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Use the Node
os API in Chrome Apps
This library can be used directly with your browserify builds with targeting Chrome Packaged Apps.
$ npm install chrome-os --save $ browserify -r chrome-os:os index.js -o bundle.js
$ npm test
This will load the folder
test/chrome-app as an unpacked extension in chrome.
Test currently designed for windows and Mac Canary support for others accepted
The following permissions need to be added to your chrome packaged app for this module.
"permissions": [ "system.memory", "system.cpu" ]
The chrome apis do not support sync calls for some of the corresponding features so the calls have been made async.
Currently these are
platform(callback(platform)) The platform string maps to the expected node value.
There is currently a console warning and 'Not Supported' is returned if these functions are called without a callback. It should be noted that browserify doesn't fully support these either only returning placeholders. If users are interested in full cross platform support then an async-os implementation could be implemented.