Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
abstract-chunk-store
Advanced tools
A test suite and interface you can use to implement a chunk based storage backend
npm install abstract-chunk-store
Send a PR adding yours if you write a new one.
chunkStore = new ChunkStore(chunkLength)
Create a new chunk store. Chunks must have a length of chunkLength
.
chunkStore.put(index, chunkBuffer, [cb])
Add a new chunk to the storage. Index should be an integer.
chunkStore.get(index, [options], cb)
Retrieve a chunk stored. Index should be an integer. Options include:
{
offset: chunkByteOffset,
length: byteLength
}
If the index doesn't exist in the storage an error should be returned.
chunkStore.close([cb])
Close the underlying resource, e.g. if the store is backed by a file, this would close the file descriptor.
chunkStore.destroy([cb])
Destroy the file data, e.g. if the store is backed by a file, this would delete the file from the filesystem.
chunkStore.chunkLength
Expose the chunk length from the constructor so that code that receives a chunk store can know what size of chunks to write.
Publishing a test suite as a module lets multiple modules all ensure compatibility since they use the same test suite.
To use the test suite from this module you can require('abstract-chunk-store/tests')
.
An example of this can be found in the memory-chunk-store test suite.
To run the tests simply pass your test module (tap
or tape
or any other compatible
modules are supported) and your store's constructor (or a setup function) in:
var tests = require('abstract-chunk-store/tests')
tests(require('tape'), require('your-custom-chunk-store'))
If you make a new module that uses the abstract-chunk-store
API, include this badge in your readme!
[![abstract chunk store](https://cdn.rawgit.com/mafintosh/abstract-chunk-store/master/badge.svg)](https://github.com/mafintosh/abstract-chunk-store)
An abstract chunk store is a binary data store that allows you to interact with individual chunks of a larger blob (a.k.a. binary file). A chunk can be thought of as a small partial blob that fits in memory.
Related:
MIT
FAQs
A test suite and interface you can use to implement a chunk based storage backend
The npm package abstract-chunk-store receives a total of 8 weekly downloads. As such, abstract-chunk-store popularity was classified as not popular.
We found that abstract-chunk-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.