Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

@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/lacy

License

MIT