
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
caslet
is a simple content storage system that allows you to store files uniquely (i.e. the same file will be stored only once).
npm install -g caslet
Command Line Usage
# to store files into the storage system.
$ caslet store /file/to/be/stored destination/file/path
==> a sha1 hash will be returned.
# get the file by destination/file/path
$ caslet get destination/file/path target/file/path
# get the file by hash
$ caslet gethash hash target/file/path
By default, caslet
will hold its content at $HOME/.caslet
directory. To change the particular directory, pass in -b|--baseDir a/different/directory
as part of the command line call.
$ caslet -b ./assets store /file/to/be/stored destination/file/path
$ caslet -b ./assets pathget destination/flie/path target/file/path
$ caslet -b ./assets hashget hash target/file/path
var CAS = require('caslet');
CAS.initialize({baseDir: './assets'}, function(err, cas) {
cas.store(...);
cas.storeWithPath(...);
cas.get(...);
});
CAS.initialize(options, function(err, cas) { ... })
Create the CAS object with CAS initialize - this is where we pass in the initialization parameters.
The following are the values of the option object
baseDir
: the root directory of the CAS repo. Defaults to $HOME/.caslet
if not passed in.The returned cas
object have the following functions:
cas.store(filePath, function(err, hash) { ... })
This call stores the file located at filePath
to destPath
, and returns its sha1 hash through the callback.
cas.storeWithPath(filePath, destPath, function(err, hash) { ... })
This wraps around cas.store
with an addition of destPath
that can be also be used for retrieving the file.
cas.get(options, function (err, stream) { ... })
Get the content as a stream.
Options is a JSON object with either hash
(the hash returned) or path
(the path supplied to cas.storeWithPath
).
FAQs
A simple content addressable system
The npm package caslet receives a total of 0 weekly downloads. As such, caslet popularity was classified as not popular.
We found that caslet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.