Socket
Socket
Sign inDemoInstall

react-safe-storage

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-safe-storage

Local storage with encryption


Version published
Weekly downloads
9
increased by200%
Maintainers
1
Install size
12.8 kB
Created
Weekly downloads
 

Readme

Source

react-safe-storage

Local storage with encryption

NPM JavaScript Style Guide

Install

npm install --save react-safe-storage

Dependencies

This module is pure javascript code and does not have any depencencies

Security

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.

Configuration

This component needs a secret passphrase that is used for ciphering and deciphering. Ideally, the secret passphrase should come from environment variables.

Functionality


/*

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') {}

Usage


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

License

MIT © superflows-dev

Keywords

FAQs

Last updated on 21 Jul 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc