Package Exports
- disk
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (disk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Disk
Install via npm
$ npm install --save disk
Usage
var Disk = require( 'disk' )
Set up a device to work with. This can be anything with a blockdevice compatible API.
var device = new BlockDevice({
path: BlockDevice.getPath( 0 )
})
var disk = new Disk( device )
disk.open( function( error ) {
// Opens a handle to the device and attempts
// to detect it's block size if unspecified,
// as well as reading the MBR & GPT on the device
})
disk.readMBR( function( error, mbr ) {
// ...
})
disk.writeMBR( function( error ) {
// ...
})
disk.readGPT( function( error, gpt ) {
// ...
})
disk.verifyGPT( function( error, backupGPT ) {
// ...
})
disk.close( function( error ) {
// Closes the handle to the device
})
API
Disk
new Disk( device )
Properties:
- device
- mbr
- gpt
Methods:
- open( callback )
- close( callback )
- getEFIPart()
- readMBR( callback )
- writeMBR( callback )
- readGPT( callback )
- writeGPT( callback ): Not implemented