Socket
Book a DemoInstallSign in
Socket

random-access-page-files

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-access-page-files

An abstract-random-access backend that writes to fixed size page files instead of a single file. Useful for sparse data.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

random-access-page-files

An abstract-random-access backend that writes to fixed size page files instead of a single file. Useful for sparse data.

npm install random-access-page-files

build status

Usage

var pages = require('random-access-page-files')

var storage = pages('a-folder', {
  pageSize: 5 * 1024 * 1024 // use 5mb pages
})

// will write use single page file < 5mb
storage.write(222852525, new Buffer('hello'), function (err) {
  if (err) throw err
  storage.read(222852525, 5, function (err, buf) {
    if (err) throw err
    console.log(buf)
  })
})

API

var storage = pages(folder, [options])

Create a new storage provider. Options include:

{
  pageSize: 5 * 1024 * 1024, // how big are the page files?
  limit: 16 // how many open files at max?
}

License

MIT

FAQs

Package last updated on 19 Oct 2016

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