Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@metarhia/filestorage
Advanced tools
FileStorage is a library that allows to easily store a large number of binary files.
Data will be spread across the file tree to optimize read and write speeds and can be accessed by a unique id.
Large files can be compressed using either ZIP
or GZIP
and automatically decompressed on reading.
It is strongly recommended to use filestorage.create
to get new FileStorage
instance
because it will also create a root directory if it does not yet exist in the file system.
Example with existing directory:
const { FileStorage } = require('filestorage');
const storage = new FileStorage({ dir: './root-directory', minCompressSize: 2048 });
Example with create:
const { create } = require('filestorage');
create({ dir: './root' }, (err, storage) => { ... });
FileStorage(options)
options:
<Object>
FileStorage.prototype.write(id, data, opts, cb)
id
<common.Uint64>
id of filedata:
<string>
|
<Uint8Array>
<Buffer>
data to be writtenopts:
<Object>
cb:
<Function>
callback
Throws: <TypeError>
if opts.checksum
or opts.dedupHash
is incorrect
FileStorage.prototype.update(id, data, opts, cb)
id
<common.Uint64>
id of filedata:
<string>
|
<Uint8Array>
<Buffer>
data to be writtenopts:
<Object>
cb:
<Function>
callback
Throws: <TypeError>
if opts.checksum
or opts.dedupHash
is incorrect
FileStorage.prototype.stat(id, cb)
id
<common.Uint64>
id of filecb:
<Function>
callback
err:
<Error>
stats
<fs.Stats>
FileStorage.prototype.read(id, opts, cb)
id
<common.Uint64>
id of fileopts:
<Object>
cb:
<Function>
callback
FileStorage.prototype.rm(id, cb)
id
<common.Uint64>
id of filecb:
<Function>
callback
err:
<Error>
FileStorage.prototype.compress(id, compression, cb)
id
<common.Uint64>
id of filecompression:
<string>
compression typecb:
<Function>
callback
Throws: <TypeError>
if compression is incorrect
create(options, cb)
options:
<Object>
cb:
<Function>
callback
err:
<Error>
storage
<FileStorage>
[0.1.0][] - 2019-01-23
FAQs
Metarhia File Storage
The npm package @metarhia/filestorage receives a total of 1 weekly downloads. As such, @metarhia/filestorage popularity was classified as not popular.
We found that @metarhia/filestorage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.