Socket
Socket
Sign inDemoInstall

@converse/localforage-getitems

Package Overview
Dependencies
3
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @converse/localforage-getitems

Adds getItems method to localForage.


Version published
Weekly downloads
164
decreased by-40.15%
Maintainers
2
Install size
570 kB
Created
Weekly downloads
 

Readme

Source

@converse/localforage-getitems

This is a fork of localforage-getitems which adds support for the getAll function for IndexedDB.

The upstream pull request is here: https://github.com/localForage/localForage-getItems/pull/12

The upstream project appears to be unmaintained and hasn't had any changes in 5 years.

Requirements

  • localForage v1.4.0+
    • for earlier versions of localforage, please use the v1.1.x releases

Installation

npm i @converse/localforage-getitems

API

Just like getItem() but you can pass an array with the keys that need to be retrieved.

const keys = ['asdf','asap','async'];

localforage.getItems(keys).then((results) => {
  console.log(results);
  // prints:
  // {
  //   asdf: 'asdf value!',
  //   asap: 'asap value!',
  //   async: 'async value!'
  // }

  console.log(results.asdf);
  console.log(results['asdf']);
  console.log(results[keys[0]]);
  // all the above print 'asdf value!'
});

Invoking getItems() without arguments (or with null as the first argument) will retrieve all the items of the current driver instance.

localforage.getItems().then((results) => { });

// or by using callbacks
localforage.getItems(null, results) => { });

Keywords

FAQs

Last updated on 14 Feb 2023

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