Home

Awesome

Block Device

npm npm license npm downloads build status

Install via npm

$ npm install --save blockdevice

Usage Examples

API

new BlockDevice( options )

BlockDevice.getPath( id )

device.open( callback )

device.close( callback )

device.detectBlockSize( size, step, limit, callback )

device.detectSize( step, callback )

device.partition( options )

device.getLBA( cylinder, head, sector )

device._read( offset, length, buffer, callback )

INTERNAL. Used by .readBlocks().

device.readBlocks( fromLBA, toLBA, buffer, callback )

device._write( offset, buffer, callback )

INTERNAL. Used by .writeBlocks().

device.writeBlocks( fromLBA, buffer, callback )

new BlockDevice.Partition( device, options )

get partition.blockSize -> Number

get partition.sectors -> Number, number of blocks in partition

get partition.size -> Number, size in bytes

partition.__OOB( lba )

INTERNAL. Determines if a given LBA is out of bounds of the partition.

partition.readBlocks( from, to, buffer, callback )

partition.writeBlocks( from, data, callback )