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

fat32

v0.2.0

Published

FAT32 file system driver

Downloads

12

Readme

FAT32 File System

npm npm license npm downloads build status

FAT12/16/32 file system driver

Install via npm

$ npm install --save fat32

Features

  • [x] Reading volume boot & information sector
  • [ ] Reading of clusters and cluster chains
  • [ ] Write support
  • [ ] Node fs compatible API
  • [ ] Defragmentation
  • [ ] Transactions (if multiple FATs are present)

Usage

Related Modules

  • ExFAT - ExFAT file system driver
  • NTFS - NTFS file system driver
  • HFS+ - HFS+ file system driver
  • Ext4 - Ext4, Ext3, Ext2 file system driver
  • MBR - Master Boot Record (MBR)
  • GPT - GUID Partition Table (GPT)
  • BlockDevice - Reads from & writes to block devices, or treats files as block devices
  • Disk - Handles a formatted block device (reads the MBR and GPT, creates bounded partitions with BlockDevice APIs)

Mounting a partition from a block device

var BlockDevice = require( 'blockdevice' )
var Disk = require( 'disk' )
var FAT = require( 'fat32' )

var device = new BlockDevice({
  path: '/dev/rdisk2', // or i.e. '\\\\.\\PhysicalDrive2' on Windows
})

var disk = new Disk( device )
var volume = new FAT.Volume()

disk.open(( error ) => {

  // For purposes of demonstration, error handling will
  // not be tended to in this example, but should of course
  // be implemented in real-world use cases
  if( error ) return handleError( error )

  // Find a FAT formatted partition
  var partNo = disk.mbr.partitions.findIndex(( partition ) => {
    return partition.type === 0x0B || partition.type === 0x0C
  })

  // Mount the partition (with a BlockDevice API)
  volume.mount( disk.partitions[ partNo ], null, ( error ) => {
    console.log( util.inspect( volume ) )
    // ...
    volume.unmount(( error ) => {
      disk.close(( error ) => {
        // ...
      })
    })
  })

})
Volume {
  device: Partition {
    device: BlockDevice {
      fd: 13,
      path: '/dev/rdisk2',
      mode: 'r',
      blockSize: 512,
      size: -1,
      headsPerTrack: -1,
      sectorsPerTrack: -1
    },
    firstLBA: 8192,
    lastLBA: 137216
  },
  bits: 32,
  readOnly: true,
  vbr: VBR {
    jmp: <Buffer eb 58 90>,
    oemName: 'mkfs.fat',
    sectorSize: 512,
    sectorsPerCluster: 1,
    reservedSectors: 32,
    numberOfFATs: 2,
    rootDirEntries: 0,
    sectorCount: 129024,
    mediaType: 248,
    sectorsPerFAT: 993,
    sectorsPerTrack: 32,
    numberOfHeads: 64,
    hiddenSectors: 0,
    fsType: 'FAT32   ',
    flags: 0,
    version: '0.0',
    rootClusterSector: 2,
    fsInfoSector: 1,
    mirrorSector: 6,
    reserved: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00>,
    driveNumber: 128,
    corrupted: 0,
    extendedSignature: 41,
    id: 1892531337,
    name: 'boot       ',
    code: <Buffer 0e 1 f be 77 7 c ac 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e 6 f 74 20 61 20 62 6 f 6 f 74 61 62 6 c...>,
    signature: 43605,
    rootCluster: 2
  },
  info: FSInfo {
    reserved1: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00...>,
    freeClusters: 85480,
    lastCluster: 41530,
    reserved2: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00>
  },
  tables: [{
    id: 268435448,
    eoc: 4279238655,
    buffer: <Buffer f8 ff ff 0 f ff ff ff 07 65 00 00 00 ac a0 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0 a 00 00 00 0b 00 00 00 0 c 00 00 00 0 d 00...>
  }, {
    id: 268435448,
    eoc: 4279238655,
    buffer: <Buffer f8 ff ff 0 f ff ff ff 07 65 00 00 00 ac a0 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0 a 00 00 00 0b 00 00 00 0 c 00 00 00 0 d 00...>
  }]
}

References