npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

secured-storage

v1.0.6

Published

This is a secure way of storing key value in the browser based on localstorage and with military-grade encryption.

Downloads

41

Readme

What is secure storage and why should we use it?

Has it happened to you that you want to save sensitive data at the frontend level? Or you do not want information that we commonly store in localstorage or sessionstorage to be intercepted by the user or even by attackers, because due to these problems we have decided to create a plugin to allow secure storage in a very simple way, where you will no longer have to worry about encryption, keys, etc.

What is the operation?

To encrypt the information, AES of the CTR No Padding type is used, which is approved as part of the OWASP standards as a secure encryption algorithm, then it is saved to localStorage or sessionStorage depending on how you configure it in key/value format, for which the key is encrypted in MD5 and the value in AES CRT No Padding

How to install it?

npm (recommended)

$ npm i secured-storage --save

yarn

$ yarn add secured-storage

How is it used?

Initialization

We can initialize the library with the following code:

import { SecuredStorage } from 'secured-storage';

SecuredStorage.initalize({
  key: "r')[4Zkj<X+~^-YH" // The password is optional, if you do not send it, it is automatically generated following the strictest standards
});

How to encrypt and save

To save securely you just have to call the "set" function, the first parameter is the key and the second parameter is the value, as shown in the following code example:

import { SecuredStorage } from 'secured-storage';

SecuredStorage.set("name", "Charlotte Smith");

How to decrypt and retrieve

To obtain a value and use the automatic decryption, just call the "get" function and it will return the value automatically

import { SecuredStorage } from 'secured-storage';

const name = SecuredStorage.get("name");

console.log(name); // Charlotte Smith

How delete

We can delete a record, specifying the value of its key

import { SecuredStorage } from 'secured-storage';

SecuredStorage.delete("name"); // This will permanently delete the name attribute

How to clear all storage

We can clean all the storage with a single command

import { SecuredStorage } from 'secured-storage';

SecuredStorage.clear(); // This will erase all storage permanently