Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saturngod/freedisk
freedisk is a get drive information for Node.js with *nix OS. It's using df -h command.
https://github.com/saturngod/freedisk
Last synced: 26 days ago
JSON representation
freedisk is a get drive information for Node.js with *nix OS. It's using df -h command.
- Host: GitHub
- URL: https://github.com/saturngod/freedisk
- Owner: saturngod
- Created: 2013-03-04T08:25:53.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-26T17:32:56.000Z (over 11 years ago)
- Last Synced: 2024-11-20T21:55:23.188Z (about 1 month ago)
- Language: JavaScript
- Size: 115 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Freedisk is using `df -h` command. So, it's only available for *nix system like Linux , Unix and Mac OSX ,etc.
#Install
npm install freedisk
#Example
var freedisk = require("./freedisk.js");
freedisk.drivelist(function(error,drives){
if (error !== null) {
console.log(error);
}
else {for (var i = 0; i < drives.length; i++) {
(function (mydrive) {
freedisk.detail(mydrive,function(error,total,used,free){
if (error !== null) {
console.log(error);
}
else {
//total != used+free because it's using df -h
console.log("Drive : " + mydrive);
console.log("Total : " + total);
console.log("Used : " + used);
console.log("Free : " + free);
}});//end of detail
}(drives[i])); // end closure
}
}
});