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

localsafe

v0.0.2

Published

Introducing Localsafe: πŸ”’ Your Browser's Secure Storage Solution! Localsafe ensures your data stays safe and encrypted in browser local storage. With seamless data storage and retrieval, plus tools to check available space and optimize usage, Localsafe

Downloads

18

Readme

localsafe

Table of Contents

  1. Introduction
  2. Features
  3. Installation
  4. Function Details
  5. Security Considerations
  6. License

Secure and Easy Local Storage Management for JavaScript

Localsafe: πŸ”’ Your Browser's Secure Storage Solution! Localsafe ensures your data stays safe and encrypted in browser local storage. With seamless data storage and retrieval, plus tools to check available space and optimize usage, Localsafe makes managing local storage a breeze. The real game-changer? Localsafe's compression technology lets you store large datasets exceeding the 5 MB limit, without sacrificing speed or security. Experience hassle-free, secure local storage management with Localsafe. Try it now and revolutionize your development workflow! πŸš€",

Features

  • πŸ›‘οΈ AES Encryption: Encrypts data using Advanced Encryption Standard (AES) encryption for enhanced security.
  • πŸ—οΈ Secret Key Management: Supports secure management of secret keys for encryption and decryption.
  • πŸ“¦ Simple API: Provides a simple and intuitive API for easy integration and usage.
  • 🌐 Browser Compatibility: Works seamlessly across major web browsers.
  • πŸ“ˆ Storage Metrics: Allows calculation of storage size and free space for efficient storage management.
  • ♻️ Clear Function: Includes a function to clear all data from local storage, ensuring data privacy.
  • βš™οΈ Flexible Configuration: Supports customization through environment variables and configuration options.
  • πŸ“„ Detailed Documentation: Comprehensive documentation with examples and usage guidelines.
  • 🌟 Active Development: Continuously updated with new features and improvements.

Installation

You can install localsafe via npm:

npm install localsafe
import { setEncryptedItem, getDecryptedItem, removeItem,  hasItem, getAllItems, getTotalSize, getItemSize getFreeSpace, } from "localsafe";

Function Details

setEncryptedItem(key: string, value: string, secret: string): void

Encrypts and stores a key-value pair in local storage using AES encryption.

Parameters:

  • key: The key under which the encrypted value will be stored.
  • value: The value to be encrypted and stored.
  • secret: The secret key used for encryption.

getDecryptedItem(key: string, secret: string): any | null

Retrieves and decrypts a value from local storage based on the key.

Parameters:

  • key: The key of the item to retrieve and decrypt.
  • secret: The secret key used for decryption.

Returns: The decrypted value if found, or null if the key is not found or decryption fails.


removeItem(key: string): void

Removes an item from local storage based on the provided key.

Parameters:

  • key: The key of the item to remove.

clear(): void

Removes all items from local storage, effectively clearing the entire storage space.

Note: This action is irreversible and will remove all data stored in local storage.


hasItem(key: string): boolean

Checks if an item exists in local storage based on the provided key.

Parameters:

  • key: The key of the item to check.

Returns: true if the item exists, false otherwise.


getAllItems(secret: string): Record<string, string>

Retrieves all key-value pairs from local storage as an object.

Returns: An object containing all key-value pairs stored in local storage.


getTotalSize(): number

Calculates and returns the total size of data stored in local storage in bytes.

Returns: The total size of data in local storage.


getItemSize(key: string): number | null

Calculates and returns the size of a specific item stored in local storage in bytes.

Parameters:

  • key: The key of the item to check.

Returns: The size of the item if found, or null if the item does not exist.


getFreeSpace(): number

Calculates and returns the available free space in local storage in bytes.

Returns: The available free space in local storage.


Security Considerations

  • Encryption: All data stored using localsafe is encrypted using AES encryption, enhancing data security.

  • Secret Key: Ensure that you use a strong and secure secret key for encryption and decryption to prevent unauthorized access. Store your secret keys securely in .env files.

Issue/Error

For any hiccups with the package, drop an email to [email protected] with "Error || LocalSafe" as the subject. πŸ“§