0.0.1 • Published 11 years ago

wake-event v0.0.1

Weekly downloads
597
License
-
Repository
github
Last release
11 years ago

wake-event

Simple browserify module based on this clever trick by Alex MacCaw.

It simply exports a single function that you can pass a callback to.

When your computer wakes from sleep your callback will be called.

If you're not using a module system or using AMD use the wake-event.bundle.js file instead.

var wakeEvent = require('wake-event');

wakeEvent(function () {
    console.log('computer woke up!');
});

If you're not using a module system at all, use Alex's jQuery plugin or just include the bundle file by itself.

<script src="wake-event.bundle.js"></script>
<script>
    wakeEvent(function () {
        console.log('computer awake!');
    });
</script>

Installing

npm install wake-event

Credits

Props for the core idea to Alex. Written by @HenrikJoreteg.

License

MIT