Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
react-safe-storage
Advanced tools
Local storage with encryption
npm install --save react-safe-storage
This module is pure javascript code and does not have any depencencies
It is a simple cipher based utility and does not guarantee military grade security. But it does not have any dependencies on any external library and does the job.
This component needs a secret passphrase that is used for ciphering and deciphering. Ideally, the secret passphrase should come from environment variables.
/*
secret_passphrase: secret password used for ciphering & deciphering
key: key for local storage
value: value to be stored in local storage for the specified key
*/
setItem('secret_passphrase', 'key', 'value') {}
getItem('secret_passphrase', 'key') {}
import React from 'react'
import { getItem, setItem } from 'react-safe-storage'
const App = () => {
setItem('secret_passphrase', 'email', 'hrus********e@gmail.com')
console.log(getItem('secret_passphrase', 'email'));
return <div>Hello Safe Storage</div>
}
export default App
MIT © superflows-dev
FAQs
Local storage with encryption
We found that react-safe-storage 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.