pull-random-access

1.0.1 • Public • Published

pull-raf

pull-raf is a slightly higher level api on top of random-access-storage so as to easily adapt other modules written on top of the node fs module.

example

const RAF = require('random-access-file')
const Praf = require('pull-raf')
 
const praf = Praf(RAF(filename))
 
pull(
  praf.createReadStream(),
  ...
)
 
praf.append(..., cb)
 

api: Praf(RAF) => {read, write, stat, close, destroy, append, createReadStream}

just passes standard RAF methods through (read, write, stat, close, destroy) but adds (append, createReadStream)

praf.append(buffer, cb)

append buffer to the end of the file. throws an error if something else is already being appended.

I would merge a PR to queue appends.

praf.createReadStream(opts) => PullSource

return a pull-stream

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i pull-random-access

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.87 kB

Total Files

5

Last publish

Collaborators

  • dominictarr