https://github.com/mastilver/win-vol
https://github.com/mastilver/win-vol
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mastilver/win-vol
- Owner: mastilver
- License: mit
- Created: 2015-07-14T17:53:27.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-12-23T13:03:25.000Z (over 9 years ago)
- Last Synced: 2025-10-31T06:40:07.974Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# osx-vol [](https://travis-ci.org/gillstrom/osx-vol)
> Get and set volume in OS X systems.
## Install
```
$ npm install --save osx-vol
```
## Usage
```js
var osxVol = require('osx-vol');
osxVol.get(function (err, level) {
console.log(level);
//=> 0.45
});
osxVol.set(0.65, function (err) {
console.log('Changed volume to 65%');
});
```
## API
### .get(callback)
Get volume level.
#### callback(err, level)
Type: `function`
##### level
Type: `number`
Current volume level.
### .set(level, callback)
Set volume level.
#### level
*Required*
Type: `number`
A number between `0` and `1.
#### callback(err)
Type: `function`
## CLI
See the [vol](https://github.com/gillstrom/vol) CLI.
## License
MIT © [Andreas Gillström](http://github.com/gillstrom)