
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.
forcha
VmoStore is a local cache management class designed for convenient data management, storage, and retrieval in a browser environment. It is engineered to include version control, namespace isolation, and configurable storage capacity limits, making it suitable for various caching scenarios.
npm i vmo-store
const vmoStore = new VmoStore({
namespace: 'myApp', // Namespace
prefix: 'APP', // Prefix alias
version: 1, // Version
cryptoKey: 'yourCryptoKeyHere', // Encryption key. If empty, cache encryption will not be enabled
dataProps: {
user: {
type: String, // Data type supports multiple types [String, Array, Number]
storge: 'localStorage', // Specify localStorage
default: '111', // Default value
expireTime: '1d' // Expiration time of 1 day,
/**
* Expiration time can be set in 3 ways:
* 1. Numeric value: In milliseconds added from the time of writing or updating + expireTime
* 2. Character type: s for seconds, m for minutes, h for hours, d for days; converted to milliseconds before adding from the time of writing or updating + expireTime
* 3. Fixed date format "YYYY-MM-DD HH:mm:ss" for fixed expiration
*/
},
settings: {
type: [Object, Array], // Data type
default: () => ({}), // For reference types, use a function form to return the default value
storge: 'sessionStorage' // Specify sessionStorage as the cache
}
}, // Store data declaration
capacity: {
localStorage: 5000, // LocalStorage limit
sessionStorage: 3000 // SessionStorage limit
},
cacheInitCleanupMode: 'self' // Cache cleanup mode on initialization, options are 'all': clear all except self or 'self': clear only caches with the same namespace and prefix alias except for different versions
})
TypeScript
const vmoStore = new VmoStore<{user:string,settings:Record<string,any>|any[]}>({
namespace: 'myApp', // Namespace
prefix: 'APP', // Prefix alias
version: 1, // Version
cryptoKey: 'yourCryptoKeyHere', // Encryption key. If empty, cache encryption will not be enabled
dataProps: {
user: {
type: String, // Data type supports multiple types [String, Array, Number]
storge: 'localStorage', // Specify localStorage
default: '111', // Default value
expireTime: '1d' // Expiration time of 1 day,
/**
* Expiration time can be set in 3 ways:
* 1. Numeric value: In milliseconds added from the time of writing or updating + expireTime
* 2. Character type: s for seconds, m for minutes, h for hours, d for days; converted to milliseconds before adding from the time of writing or updating + expireTime
* 3. Fixed date format "YYYY-MM-DD HH:mm:ss" for fixed expiration
*/
},
settings: {
type: [Object, Array], // Data type
default: () => ({}), // For reference types, use a function form to return the default value
storge: 'sessionStorage' // Specify sessionStorage as the cache
}
}, // Store data declaration
capacity: {
localStorage: 5000, // LocalStorage limit
sessionStorage: 3000 // SessionStorage limit
},
cacheInitCleanupMode: 'self' // Cache cleanup mode on initialization, options are 'all': clear all except self or 'self': clear only caches with the same namespace and prefix alias except for different versions
})
vmoStore.setData('user', 'John Doe')
const user = vmoStore.getData('user')
// Clear data by property
vmoStore.clearData('user')
// Clear all cache data
vmoStore.clear('localStorage')
vmoStore.updateProp({
newProp: { type: Number, default: 0, storge: 'localStorage' }
})
const props = vmoStore.getProps()
const namespace = vmoStore.getNameSpace()
const capacity = vmoStore.getCapacity()
constructor(config: StoreParams): Initializes a VmoStore instance. The config object is used to configure namespace, version, encryption key, data properties, storage capacities, and cache cleaning mode.
setData(prop: string, value: any): Sets cache data.
getData(prop: string): Retrieves cache data.
clear(type?: ‘localStorage’ | ‘sessionStorage’): Clears the specified type of storage; if unspecified, clears all storage.
clearData(prop: string | string[]): Clears specified cache data.
removeProp(prop: string | string[]): Removes cache declaration and data.
updateProp(props: DataProps): Updates cache property definitions.
getCapacity(): Gets current storage capacity usage and limits.
getProps(key?: string): Retrieves cache property definitions.
getNameSpace(): Retrieves namespace definition.
VmoStore may throw errors in certain scenarios, such as when storage capacity is exceeded or property types mismatch. Ensure sufficient storage space is configured for large data volumes.
FAQs
storage proxy
We found that vmo-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
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.