@book-effect/open-library
v0.2.3
Published
[Effect][effect]-based client for the [Open Library API][open-library-api].
Readme
@book-effect/open-library
Effect-based client for the Open Library API.
Open Library provides a free, open, well-documented REST API for books, authors, subjects, covers, and more. It supports lookup by ISBN, OLID, and search queries.
Installation
pnpm add @book-effect/open-libraryUsage
import { OpenLibraryClient } from "@book-effect/open-library";
import { FetchHttpClient } from "@effect/platform";
import { Effect } from "effect";
const program = Effect.gen(function* () {
const client = yield* OpenLibraryClient;
const book = yield* client.getByIsbn("9780134757599");
const results = yield* client.search("Domain Driven Design");
return { book, results };
});
Effect.runPromise(
program.pipe(
Effect.provide(OpenLibraryClient.Live),
Effect.provide(FetchHttpClient.layer),
),
);Building
nx build open-library