
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@students-dev/local-storage-api
Advanced tools
A comprehensive, production-ready client-side storage API with advanced features, automatic fallbacks, and developer tooling
Created by Ramkrishna Bhatt V, Milagres PU College, Kallianpur, Udupi
A comprehensive, production-ready client-side storage API with advanced features, automatic fallbacks, and developer tooling. Store any data type including Objects, Arrays, Blobs, Files, Buffers, TypedArrays, JSON, numbers, strings, booleans, Maps, and Sets.
npm install @students-dev/local-storage-api
const { LocalStorageAPI, useStore } = require('@students-dev/local-storage-api');
const storage = new LocalStorageAPI();
// Simple API
await storage.save('user', { name: 'Alice', age: 25 });
const user = await storage.load('user');
await storage.delete('user');
// Namespaced storage
const appStorage = useStore('myapp');
await appStorage.save('config', { theme: 'dark' });
// Batch operations
await storage.saveMany([
['setting1', 'value1'],
['setting2', 'value2']
]);
const values = await storage.loadMany(['setting1', 'setting2']);
// Export/Import
const data = await storage.exportJSON();
await storage.importJSON(data);
// Core operations
await storage.save(key, value, options?)
await storage.load(key) // -> value or null
await storage.delete(key)
await storage.reset() // Clear all
// Utility
await storage.exists(key) // -> boolean
await storage.count() // -> number
await storage.all() // -> { key: value, ... }
// Batch
await storage.saveMany([[key1, value1], [key2, value2]])
await storage.loadMany([key1, key2]) // -> { key1: value1, ... }
await storage.deleteMany([key1, key2])
// Import/Export
await storage.exportJSON() // -> JSON string
await storage.importJSON(jsonString)
await storage.exportFile() // Browser download
// Direct access
await storage.set(key, value, { ttl: 3600 })
await storage.get(key)
await storage.remove(key)
await storage.clear()
// Querying
const results = await storage.query()
.filter(value => value.price > 100)
.sort((a, b) => a.price - b.price)
.limit(10)
.execute()
// Snapshots
await storage.saveSnapshot('backup')
await storage.loadSnapshot('backup')
const diff = storage.compareSnapshots('snap1', 'snap2')
// Metrics
const metrics = storage.getMetrics()
// { reads: 10, writes: 5, avgReadLatency: 2.3, ... }
// Events
storage.on('change', (event) => {
console.log('Storage changed:', event);
});
const storage = new LocalStorageAPI({
namespace: 'myapp',
profile: 'max-compression', // ultra-fast, max-compression, low-memory, safe-mode
debug: true,
safeMode: false,
hooks: {
beforeSet: (key, value) => {
// Validate or transform
return value;
}
},
encryption: {
preWriteEncrypt: (data) => encrypt(data),
postReadDecrypt: (data) => decrypt(data)
},
sync: {
channel: new BroadcastChannel('my-app-sync')
}
});
# Install globally
npm install -g @students-dev/local-storage-api
# Commands
local-storage-api inspect # Show storage stats
local-storage-api export data.json # Export to file
local-storage-api import data.json # Import from file
local-storage-api visualize # Data type charts
local-storage-api benchmark # Performance test
Install the "Local Storage API" extension for advanced debugging:
See the examples/ directory:
examples/plain-js.js - Vanilla JavaScriptexamples/react.js - React hooksexamples/vue.js - Vue composablesexamples/svelte.js - Svelte stores# Install dependencies
npm install
# Run tests
npm test
# Build
npm run build
# Lint
npm run lint
# Format code
npm run format
The API implements a layered storage architecture:
Automatic fallback ensures reliability across all environments.
The v1.0.0 introduces breaking changes:
store() renamed to save()retrieve() renamed to load()// Old v0.x
await store('key', 'value');
const value = await retrieve('key');
// New v1.0.0
await storage.save('key', 'value');
const value = await storage.load('key');
MIT License - see LICENSE file for details.
© 2024 Ramkrishna Bhatt V (Milagres PU College, Kallianpur, Udupi). All rights reserved.
FAQs
A comprehensive, production-ready client-side storage API with advanced features, automatic fallbacks, and developer tooling
We found that @students-dev/local-storage-api 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.