Socket
Socket
Sign inDemoInstall

@bytesoftio/helpers-local-storage

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bytesoftio/helpers-local-storage

## Installation


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.35 MB
Created
Weekly downloads
 

Readme

Source

@bytesoftio/helpers-local-storage

Installation

yarn add @bytesoftio/helpers-local-storage or npm install @bytesoftio/helpers-local-storage

Table of contents

  • Description
  • readLocalStorage
  • writeLocalStorage

Description

This package provides several localStorage related helper functions.

readLocalStorage

Reads a value from localStorage.

import { readLocalStorage } from "@bytesoftio/helpers-local-storage"

type AuthData = { token: string | undefined }

const defaultData: AuthData = {token: undefined}
const data = readLocalStorage<AuthData>("auth", defaultData)

writeLocalStorage

Writes a value to localStorage.

import { writeLocalStorage } from "@bytesoftio/helpers-local-storage"

const data = { token: "foo" }
writeLocalStorage("auth", data)

FAQs

Last updated on 20 Jul 2020

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