
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.
storage-modifiers
Advanced tools
This is curated set of modifiers that can be used with the storage-engine
library.
This package is released in the public npm registery and should be used
inconjuction with the storage-engine library:
npm install --save storage-modifiers
npm install --save storage-engine
The following modifiers are available in this package:
Adds automatic JSON encoding and decoding. The mergeItem and multiMerge API's
of the AsyncStorage API already promote the usage of JSON for your values. This
plugin does it automatically for you.
import { json } from 'storage-modifiers';
import storage from 'storage-engine';
storage.use('*', json);
await storage.setItem('this', {
would: 'not',
work: {
without: 'the'
},
plugin: true
});
const value = await storage.getItem('this') // { would: "not", ...}
Allows you to emit an event every time when a given key is accessed, this allows you for example to track changes to values.
import { expire } from 'storage-modifiers';
import storage from 'storage-engine';
storage.use('*', expire, {
key: true,
operation: true
});
storage.on('key', function ({ method, key, value }) {
console.log(`${method} accessed "key" which now has value:`, value);
});
storage.on('setItem', function ({ method, key, value }) {
console.log('what is up from `setItem` is a called on key:', key);
});
await storage.setItem('key', 'value');
//
// console output:
//
// - setItem accessed "key" which is now has value: "value"
// - what is up from `setItem` is called on key: "key"
//
The emit plugin understands the following options:
key Emit the events with the key as event name.operation Emit the operation as event name.Allows you to automatically expire keys and remove it from your AsyncStorage.
import { expire } from 'storage-modifiers';
import storage from 'storage-engine';
storage.use('key, another, foo*', expire, {
duration: '10 minutes'
});
await storage.setItem('key', 'data'); // expires in 10 minutes
The expire plugin understands the following options:
duration The TTL of the values that get stored in these keys.Provides an additional layer of security for AsyncStorage by encrypting the
values using crypto-js. This ensures that when the AsyncStorage is flushed
to disk, the contents will still be encoded.
import { encrypt } from 'storage-modifiers';
import storage from 'storage-engine';
storage.use('secure*', encrypt, {
secret: 'your secret here',
encryption: 'SHA3'
});
The encrypt plugin understands the following options:
secret, required, The secret key/passcode to use to encode/decode contents.encryption, required, The encryption algorithm to use. Can be any of the
supported encryption libraries; https://github.com/brix/crypto-js#list-of-modules
Please note that casing is important here sha3 is invalid, while SHA3 is
accepted.(MIT)[LICENSE]
FAQs
Curated set of modifiers for storage-engine
We found that storage-modifiers 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
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.