0.8.0 • Published 7 years ago

disk v0.8.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Disk

npm npm license npm downloads build status stability

Install via npm

$ npm install --save disk

Related Modules

Internals:

Block Devices:

  • VHD – Microsoft Virtual Hard Disk format
  • UDIF – Apple's DMG / UDIF (Universal Disk Image Format)
  • UDF – OSTA Universal Disk Format

File Systems:

  • FAT32 – FAT32/16/12 file system driver
  • ExFAT – ExFAT file system driver
  • HFSX – Apple HFS+ file system driver
  • NTFS – NTFS file system driver

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 )
})

Create a disk:

var disk = new Disk( device )

Open the device:

// This also attempts to detect it's block size if unspecified,
// as well as reading the MBR & GPT on the device
disk.open( function( error ) {})

Read or write the MBR (disk.mbr) from or to the device:

disk.readMBR( function( error, mbr ) {})
disk.writeMBR( function( error ) {})

Read or write the GPT (disk.gpt) from or to the device:

disk.readGPT( function( error, gpt ) {})
disk.writeGPT( function( error ) {})

Verify the backup GPT; NOTE: The callback will be called with an error and the backup GPT if it doesn't verify.

disk.verifyGPT( function( error, backupGPT ) {})

Close the device:

disk.close( function( error ) {})

API

Disk

  • Disk.MBR: See mbr
  • Disk.GPT: See gpt

new Disk( device )

Properties:

  • device
  • mbr
  • gpt

Methods:

  • open( callback )
  • close( callback )
  • getEFIPart()
  • readMBR( callback )
  • writeMBR( callback )
  • readGPT( callback )
  • writeGPT( callback )
  • writeGPT( callback ): Not implemented
0.8.0

7 years ago

0.7.1

8 years ago

0.7.0

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

11 years ago

0.3.0

13 years ago

0.2.0

13 years ago

0.1.0

13 years ago