Sleep with native spawn-sync
This is a toy! Not production code!
This project uses spawn-sync to call the native spawnSync function. If it is not available, then it creates a script file that will be executed. The polyfill will then poll for this script to complete with "busy waiting" - not really "idle" anymore.
Install this module with the following command:
npm install idle-sleepAdd the module to your package.json dependencies:
npm install --save idle-sleepAdd the module to your package.json dev-dependencies:
npm install --save-dev idle-sleepvar idleSleep = require('idle-sleep');
console.log('Start at ' + new Date());
idleSleep(1000);
console.log('Done at ' + new Date());##Third-party libraries
The following third-party libraries are used by this module:
###Dependencies
- spawn-sync: https://github.com/ForbesLindesay/spawn-sync
##License
The MIT License
Copyright 2015 Marcel Erz