fcs

fd-chunk-store

chunk store for a single file

Showing:

Popularity

Downloads/wk

8

GitHub Stars

14

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

fd-chunk-store

implement a chunk store over a single file descriptor

example

var Store = require('fd-chunk-store')

var store = Store(5, './wow')
store.put(0, new Buffer('hello'), function (err) {
  store.get(0, function (err, buf) {
    console.log(buf)
  })
})

output:

<Buffer 68 65 6c 6c 6f>

api

var Store = require('fd-chunk-store')

var store = Store(size, path)

var store = Store(size, opts)

Create a store with chunks size bytes long at opts.path.

store.on('open', function () {})

When the underlying file descriptor is opened, 'open' fires.

store.get(i, opts={}, cb)

Get the chunk at index i as cb(err, buf).

store.put(i, buf, opts={}, cb)

Put the chunk in buf at chunk offset i.

store.destroy(cb)

Close the underlying file descriptor and destroy the underlying resource, removing the file.

store.close(cb)

Close the underlying file descriptor.

install

npm install fd-chunk-store

license

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial