Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blockdevice

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockdevice

Block Device

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

BlockDevice

npm npm downloads build status

Install via npm

$ npm install blockdevice

Usage

var BlockDevice = require( 'blockdevice' )
var device = new BlockDevice({
  // A custom 'fs' instance, defaults to require( 'fs' ) (optional)
  fs: null,
  // A file descriptor, if you have (optional)
  fd: null,
  // Path to the device
  path: null,
  // Mode defaults to 'rs+' to bypass local cache (optional)
  mode: 'rs+',
  // Device block size in bytes (optional)
  blockSize: -1,
  // Device size in bytes (optional)
  size: -1,
  // Heads per Track (for CHS addressing)
  headsPerTrack: -1,
  // Sectors per Track (for CHS addressing)
  sectorsPerTrack: -1,
})

API

  • BlockDevice( options )

  • BlockDevice.getPath( id )

  • device.open( callback( err, fd ) )

  • device.close( callback( err ) )

  • device.detectBlockSize( size, step, limit, callback( err, blockSize ) )

  • device.detectSize( step, callback( err, size ) )

  • device.partition( options )

  • device.getLBA( cylinder, head, sector )

  • device.read( offset, length, buffer, callback( err, buffer, bytesRead ) )

  • device.readBlocks( fromLBA, toLBA, buffer, callback( err, buffer, bytesRead ) )

  • device.write( offset, buffer, callback( err, bytesWritten ) )

  • device.writeBlocks( fromLBA, buffer, callback( err, bytesWritten ) )

  • BlockDevice.Partition( device, options )

  • get partition.blockSize

  • get partition.sectors

  • get partition.size

  • partition.__OOB( lba )

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

  • partition.writeBlocks( from, data, callback )

Keywords

FAQs

Package last updated on 24 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc