Description
A node.js binding to useful system-level functions.
Requirements
- node.js -- v0.6.0 or newer
Install
npm install xsys
Examples
- Get filesystem total/free/used byte counts:
var fs = fs; // format our numerical output { return val; } fs; fs; fs; // sample output: // // Total bytes for current volume: 974,656,999,424 // Free bytes for current volume: 877,061,001,216 // Used bytes for current volume: 48,814,333,952
API
Static Methods
-
fs.getTotal([<String>path,] <Function>callback) - (void) - Retrieves the number of total bytes on the volume where path is located (defaults to path of the module). The callback receives two arguments: an <Error> object in case of error (null otherwise) and a <String> containing the number of bytes.
-
fs.getTotalSync([<String>path]) - <String> - Synchronous version of getTotal().
-
fs.getFree([<String>path,] <Function>callback) - (void) - Retrieves the number of free bytes on the volume where path is located (defaults to path of the module). The callback receives two arguments: an <Error> object in case of error (null otherwise) and a <String> containing the number of bytes.
-
fs.getFreeSync([<String>path]) - <String> - Synchronous version of getFree().
-
fs.getUsed([<String>path,] <Function>callback) - (void) - Retrieves the number of used bytes on the volume where path is located (defaults to path of the module). The callback receives two arguments: an <Error> object in case of error (null otherwise) and a <String> containing the number of bytes.
-
fs.getUsedSync([<String>path]) - <String> - Synchronous version of getUsed().