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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@astrocloudllc/fridge

v1.0.3

Published

A TypeScript wrapper around react-native-async-storage. This package provides full types for all of your data to make working with AsyncStorage simpler.

Downloads

14

Readme

fridge

A TypeScript wrapper around @react-native-async-storage/async-storage that can be used to simplify working with local storage.

Install

npm install @react-native-async-storage/async-storage @astrocloudllc/fridge

or

yarn add @react-native-async-storage/async-storage @astrocloud/fridge

Setup

The easiest way to use this package is to create a file that handles your storage types and exports the types and storage object. For example, create a file called storage.ts and add the following:

import { createStorage } from "@astrocloudllc/fridge"

export interface StorageTypes {
  /* Your types go here */
}

export const storage = createStorage<StorageTypes>()

Then import the storage object in any file where you need to interact with AsyncStorage.

Functions

Fridge includes several function, most of which directly run the relevant AsyncStorage function. Most of these function handle parsing and stringifying objects to simplify code used in other places.

Getting Items

getItem

Retrieves an item from AsyncStorage and returns it as a parsed object. If the key is null the promise rejects

storage.getItem("key").then((data) => {
  //do stuff
}).catch((e) => {
  // key is null
})

getNullableItem

Similar to getItem, but instead of rejecting on null the promise resolves, similar to AsyncStorage's implementation.

storage.getNullableItem("key").then((data) => {
  // data is an object or null
})

getKey

Behaves identically to AsyncStorage.getItem() with no type checking or parsing.

storage.getKey("key").then((data) => {
  // data is a string or null
})

multiGet

Retrives multiple keys at once. The return type is different from AsyncStorage.multiGet(). Instead of two arrays this function returns an object where each key's value is the data found at that key.

interface StorageKeys {
  thing1: string[];
  thing2: number[];
}

storage.multiGet(["thing1", "thing2"]).then((data) => {
  data.thing1 // string[]
  data.thing2 // number[]
})

getAllKeys

Get an array of all keys in storage

storage.getAllKeys().then((data) => {
  //do stuff
})

Setting Items

setItem

Sets an item to storage.

storage.setItem("key", data).then(() => {
  // do stuff
})

setKey

Behaves identically to AsyncStorage.setItem() with no type checking or parsing.

multiSet

Set multiple keys at once. Accpets an object that is similar to what is returned from multiGet

storage.multiSet({
  thing1: ["a", "b", "c"],
  thing2: [1, 2, 3]
}).then(() => {
  // do stuff
})

Removing Items

removeItem

Remove an item from storage

storage.removeItem("key")

removeKey Remove any key from storage, avoiding type checking on all defined keys.

multiRemove

Remove multiple items from storage.

storage.multiRemove([
  "thing1",
  "thing2"
])

clear

Clear all keys from storage.

storage.clear()

FAQ

Does this work with Expo?

Yes! No extra setup is required, just install the package and use it as normal.

Why is it called fridge?

In theory it's cause refrigerators store things in a fairly organized manner. In reality it's cause naming stuff is hard so I just picked a thing.

Contributing

Pull requests are welcome if there are any changes you think would be beneficial or if there is a bug.