@farbenmeer/lacy
v1.0.0
Published
Lightweight utility for lazy evaluation of JavaScript promises. Chain property access and method calls without awaiting intermediate values.
Keywords
Readme
@farbenmeer/lacy
Lightweight utility for lazy evaluation of JavaScript promises. Chain property access and method calls without awaiting intermediate values.
Documentation | GitHub | npm
import { lacy } from "@farbenmeer/lacy";
// Instead of this:
const response = await fetch("/api/users");
const data = await response.json();
const name = data[0].name;
// Write this:
const name = await lacy(fetch("/api/users")).json()[0].name;Installation
npm install @farbenmeer/lacy
yarn add @farbenmeer/lacy
pnpm add @farbenmeer/lacy
bun add @farbenmeer/lacyLicense
MIT
