
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
@gradient/blob-storage
Advanced tools
Blob storage at your finger tips
Blob storage can be awkward to orchestrate, especially when you need to switch out providers for your project on demand. Blob storage makes this easier, it comes pre-bundled with a number of pre-configured providers. Blob storage is opinionated and designed to work with minimal fuss and configuration.
$ npm i @gradient/blob-storage --save
$ yarn add @gradient/blob-storage --save
Blob Storage currently supports the following clients:
For implementation details of each client see the Specific clients section.
Initialising a local blob storage object:
const getBlobStore = require('@gradient/blob-storage');
const options = {
provider: 'local',
settings: {
storageLocation: path.join(__dirname, '/tmp')
}
};
const store = getBlobStore(options);
Initialising an S3 blob storage object:
const getBlobStore = require('@gradient/blob-storage');
const options = {
provider: 's3',
settings: {
accessKeyId: 'your-iam-access-key',
secretAccessKey: 'your-iam-secret-access-key'
}
};
const store = getBlobStore(options);
All blob storage clients meet the same interface, however some clients may not have implemented all the functions if they are irrelevant. The functions provided by the clients are:
Gets an existing item.
The return value is dependant on the implementation, usually it is a buffer of the file of something similar.
Gets multiple existing items.
key, locationId, and itemType for the same purposes as the getItem function.The return value is dependant on the clients implementation, usually this is an array of file buffers or similar.
Sets a new or existing item to a new blob (if this is a service based provider such as S3, this will upload the file).
The return value is dependant on the clients implementation, usually this is a full URL or path to the blob.
Deletes the item from the blob store.
This often returns void, but this will depend on the clients implementation.
Local storage makes use of an accessible local storage that the process has access to.
Only setItem and deleteItem have been implemented for this as setItem will return the full file path to the item.
Uses AWS's S3 (Simple Storage Solution) to store blobs.
Only setItem and deleteItem have been implemented for this as setItem will return the S3 location (a url) of the item for reading.
We welcome contributions, if you'd like to create a new client implementation or complete an existing one, please submit a GitHub Pull Request. Please ensure you've written tests to check your changes.
We use yarn for this project, please ensure new packages are added using yarn so that it updates the yarn.lock file.
To run the tests, simply use yarn test!
To generate a build, run yarn build.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
FAQs
A storage plugable api for persisting data to a data store
We found that @gradient/blob-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.