@nbn23/dataloader
TypeScript icon, indicating that this package has built-in type declarations

3.3.1 • Public • Published

DataLoader

DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.

Getting Started

Install DataLoader using npm.

npm install --save @nbn23/dataloader

Note: DataLoader assumes a TypeScript environment

Usage

const DataLoader = require("dataloader");

const cache = new CacheRedis();
const itemLoader = new DataLoader((keys) => getItems(keys), cache);

const items = await itemLoader.loadMany([2, 4, 6]);

Readme

Keywords

Package Sidebar

Install

npm i @nbn23/dataloader

Weekly Downloads

18

Version

3.3.1

License

ISC

Unpacked Size

23.3 kB

Total Files

12

Last publish

Collaborators

  • nbn
  • maraat