npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vhd

v0.5.0

Published

Microsoft's Virtual Hard Disk (VHD) Format

Downloads

23

Readme

VHD - Virtual Hard Disk

npm npm npm downloads build status

VHD (Virtual Hard Disk) is a file format which represents a virtual hard disk drive (HDD). It may contain what is found on a physical HDD, such as disk partitions and a file system, which in turn can contain files and folders. It is typically used as the hard disk of a virtual machine. The format was created by Connectix for Connectix Virtual PC product, which was later acquired by Microsoft in 2003, for what is now known as Microsoft Virtual PC. Since June 2005, Microsoft has made the VHD Image Format Specification available to third parties under the Microsoft Open Specification Promise.

From Wikipedia's VHD article

Install via npm

$ npm install --save vhd

Index

Types

  • Fixed — The VHD image file is pre-allocated on the backing store for the maximum size requested.
  • Expandable — The VHD image file uses only as much space on the backing store as needed to store the actual data the virtual disk currently contains. Note: The maximum size of a dynamic virtual disk is 2,040 GB.
  • Differencing — A parent virtual disk is used as the basis of this type, with any subsequent writes written to the virtual disk as differences to the new differencing VHD image file, and the parent VHD image file is not modified. Note: The maximum size of a dynamic virtual disk is 2,040 GB.

For more information, see MSDN

Limitations

All virtual disk types have a minimum size of 3 MB.

The VHD format has a built-in limitation of just under 2 TiB (2040 GiB) for the size of any dynamic or differencing VHDs. This is due to a sector offset table that only allows for the maximum of a 32-bit quantity - Which fits our JavaScript environment perfectly, since we can't work with 64 bit integers natively.

Memory Requirements

For a maximum size dynamic or differencing VHD, the maximum Block Allocation Table size amounts to just under 4MB with the default sector size of 2MB (4096 512-byte blocks per sector)

MAX_BAT_SIZE = ( tableEntries = ( diskSize / sectorSize )) * VHD.TABLE_ENTRY_SIZE

Usage

var VHD = require( 'vhd' )

Fixed size VHD

var fixed = new VHD.Fixed( './path/to/image.vhd' )
fixed.open( function( error ) {
  if( error ) {
    // Obviously, something went wrong...
  } else {
    // Ready to read/write to/from image
  }
})
fixed.read( offset, length, function( error, bytesRead, buffer ) {
  // ...
})
fixed.write( buffer, offset, function( error, bytesWritten, buffer ) {
  // ...
})
fixed.close( function( error ) {
  // ...
})

TODO

General

  • [ ] Write tests
  • [ ] Add integration tests (with node-disk etc.)
  • [ ] Flesh out docs
    • [ ] Generate API docs
    • [ ] Complete VHD spec doc
  • [ ] Add runnable examples
  • [ ] Add PR & Issue templates (?)

Dynamic Images

  • [ ] Impl BlockDevice API
    • [ ] Impl partitions
  • [ ] Impl cross-sector reads
  • [ ] Impl writes

Fixed Images

  • [ ] Impl BlockDevice API
    • [ ] Impl partitions