diskpart v1.0.2
diskpart
Run Windows diskpart scripts in NodeJS.
Notice this module requires running with admin privileges. Use modules such as windosu to provide elevation if you require that feature.
Example:
var diskpart = require('diskpart');
diskpart.evaluate([ 'rescan' ], function(error, output) {
if (error) throw error;
console.log(output);
});Microsoft DiskPart version 6.3.9600
Copyright (C) 1999-2013 Microsoft Corporation.
On computer: DELL
Please wait while DiskPart scans your configuration...
DiskPart has finished scanning your configuration.Installation
Install diskpart by running:
$ npm install --save diskpartDocumentation
diskpart.runScript(String scriptPath, Function callback)
Run a diskpart script file.
scriptPath
The path to the script.
callback(error, output)
erroris a possible error.outputa string containing the output of the command.
Notice that if the command outputs to stderr, it will be returned wrapped in an Error instance.
Example:
var diskpart = require('diskpart');
diskpart.runScript('C:\\myDiskpartScript', function(error, output) {
if (error) throw error;
console.log(output);
});diskpart.evaluate(String[] input, Function callback)
Execute a series of diskpart commands.
input
An array of strings containing diskpart commands.
callback(error, output)
erroris a possible error.outputa string containing the output of the command.
Notice that if the command outputs to stderr, it will be returned wrapped in an Error instance.
Example:
var diskpart = require('diskpart');
diskpart.evaluate([ 'rescan', 'list disk' ], function(error, output) {
if (error) throw error;
console.log(output);
});Tests
Run the test suite by doing:
$ gulp testContribute
- Issue Tracker: github.com/resin-io/diskpart/issues
- Source Code: github.com/resin-io/diskpart
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lintSupport
If you're having any problem, please raise an issue on GitHub.
License
The project is licensed under the MIT license.
