Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.

jbenden/node-pmset

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build Status Dependency Status NPM version Code Climate Coverage Status node-pmset

OS X Power Management for Node.js

This module enables the control over power management functionality within Mac OS X 10.6 or newer. For additional information regarding this functionality, please see my blog post about this topic at:

http://www.benden.us/

Installation

$ npm install pmset

Installation via source

$ git clone https://github.com/jbenden/node-pmset.git node-pmset.git
$ cd node-pmset.git
$ npm install

Example Usage

> pmset = require("pmset");
{ noIdleSleep: [Function],
noDisplaySleep: [Function],
release: [Function] }
> a = pmset.noDisplaySleep("Node.js testing");
1248
> pmset.release(a);
0
>
(^C again to quit)
>

Notes

If you are unable to install the module, due to errors about missing Xcode header files or related, then follow the source installation instructions and change the include path in binding.gyp.

Methods Available

The module supports the following methods:

  • (int) noIdleSleep(string)
  • (int) noDisplaySleep(string)
  • (int) noSystemSleep(string)
  • (int) noUserIdleSystemSleep(string)
  • (int) noUserIdleDisplaySleep(string)
  • (int) noDiskIdle(string)
  • release(int)

To get a better understanding of what these different options mean, see the Apple header file pwr_mgt/IOPMLib.h inside of the platform SDK folder. Additionally, check out the local unit-tests for more information about the correct usage of these functions.

About

OS X Power Management for Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published