
Product
Introducing Custom Pull Request Alert Comment Headers
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
@jesselpalmer/easy-blob
Advanced tools
Quick and easy local blob storage for Node.js applications.
npm install @jesselpalmer/easy-blob
const BlobStorage = require('@jesselpalmer/easy-blob');
// Create storage instance
const storage = new BlobStorage({
storageDir: './uploads', // Optional: defaults to './uploads'
dbPath: './blobs.db' // Optional: defaults to './blob-storage.db'
});
// Start the server
storage.start(3000);
import { BlobStorage, BlobStorageOptions } from '@jesselpalmer/easy-blob';
// Create storage instance with type safety
const options: BlobStorageOptions = {
storageDir: './uploads',
dbPath: './blobs.db'
};
const storage = new BlobStorage(options);
storage.start(3000);
storageDir
(string): Directory to store uploaded files. Defaults to ./uploads
dbPath
(string): Path to SQLite database file. Defaults to ./blob-storage.db
maxFileSize
(number): Maximum file size in bytes. Defaults to 10485760
(10MB)allowedMimeTypes
(string[]): Array of allowed MIME types. Empty array allows all types.start(port)
Starts the Express server on the specified port with graceful shutdown handling.
POST /upload
Upload a file as multipart/form-data with field name blob
.
Response: {"id": 1, "message": "File uploaded successfully"}
Errors:
400
- File too large, invalid file type, or no file uploaded500
- Server errorGET /files
Get a list of all uploaded files with metadata.
Response: Array of file objects with id
, original_name
, mime_type
, path
, and upload_timestamp
.
GET /blob/:id
Retrieve a previously uploaded file by its ID.
Response: The actual file content
Errors:
400
- Invalid blob ID404
- Blob not found500
- Server errorDELETE /blob/:id
Delete a file by its ID (removes both database record and physical file).
Response: {"message": "File deleted successfully"}
Errors:
400
- Invalid blob ID404
- Blob not found500
- Server errorJavaScript:
const BlobStorage = require('@jesselpalmer/easy-blob');
const storage = new BlobStorage();
storage.start(3000);
TypeScript:
import { BlobStorage } from '@jesselpalmer/easy-blob';
const storage = new BlobStorage();
storage.start(3000);
Usage:
# Upload a file
curl -X POST -F "blob=@myfile.pdf" http://localhost:3000/upload
# Response: {"id": 1, "message": "File uploaded successfully"}
# List all files
curl http://localhost:3000/files
# Response: [{"id": 1, "original_name": "myfile.pdf", "mime_type": "application/pdf", ...}]
# Download a file
curl http://localhost:3000/blob/1 --output downloaded-file.pdf
# Delete a file
curl -X DELETE http://localhost:3000/blob/1
# Response: {"message": "File deleted successfully"}
TypeScript:
import { BlobStorage, BlobStorageOptions } from '@jesselpalmer/easy-blob';
import path from 'path';
const options: BlobStorageOptions = {
storageDir: path.join(__dirname, 'my-uploads'),
dbPath: path.join(__dirname, 'my-database.db'),
maxFileSize: 5 * 1024 * 1024, // 5MB limit
allowedMimeTypes: ['image/jpeg', 'image/png', 'application/pdf'] // Only allow specific types
};
const storage = new BlobStorage(options);
storage.start(8080);
MIT
FAQs
Quick and easy local blob storage
We found that @jesselpalmer/easy-blob demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.