{"_id":"@asmelabs/olib","_rev":"3-c8ba40cb475e0bc2818297246155d47e","name":"@asmelabs/olib","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.0":{"name":"@asmelabs/olib","version":"0.0.0","keywords":["olib","open-library","books","authors","sdk","typescript","javascript"],"author":{"name":"Mehdi Asadli","email":"asadlimehdi25@gmail.com"},"license":"MIT","_id":"@asmelabs/olib@0.0.0","maintainers":[{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"}],"homepage":"https://github.com/asmelabs/olib#readme","bugs":{"url":"https://github.com/asmelabs/olib/issues"},"dist":{"shasum":"9eb4f2dc516b942d0f0802c8075ce5b9921240fe","tarball":"https://registry.npmjs.org/@asmelabs/olib/-/olib-0.0.0.tgz","fileCount":7,"integrity":"sha512-a73LBlyXWbhsAoYpNs1UdN+PS2ty5sJATM4Ud5BDdRE1DvJsASnHtgE8Xmex/qcf5hM7dpuAh/6z5hrkwJe5Kw==","signatures":[{"sig":"MEUCIQCA7z1gQOly9oSlqSCv6CLM5mhOzFfXYurDTqIZxJqEmwIgRCuwbeAtu8Lh2qIt3OEADZYj5ErBjCCSbJ0BAP3oDEg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5721},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"921083f4bb032f22991245e2c88827c072780895","scripts":{"lint":"biome lint","test":"bun test","build":"tsup","format":"biome format --write .","prepare":"husky","release":"bun run build && changeset publish","version":"changeset version","preflight":"bun install && bun run format && bun run lint && bun run test && bun run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"},"repository":{"url":"git+https://github.com/asmelabs/olib.git","type":"git"},"_npmVersion":"10.8.2","description":"An SDK for the OpenLibrary platform","directories":{},"lint-staged":{"*.{ts,js}":["biome check --write ."]},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","husky":"^9.1.7","@types/bun":"^1.3.9","lint-staged":"^16.2.7","@biomejs/biome":"^2.3.14","@changesets/cli":"^2.29.8","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/olib_0.0.0_1770790894046_0.8443537525298397","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@asmelabs/olib","version":"0.0.1","keywords":["olib","open-library","books","authors","sdk","typescript","javascript"],"author":{"name":"Mehdi Asadli","email":"asadlimehdi25@gmail.com"},"license":"MIT","_id":"@asmelabs/olib@0.0.1","maintainers":[{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"}],"homepage":"https://github.com/asmelabs/olib#readme","bugs":{"url":"https://github.com/asmelabs/olib/issues"},"dist":{"shasum":"0058374245e782df5adff7e98af1cd2fa1c718e8","tarball":"https://registry.npmjs.org/@asmelabs/olib/-/olib-0.0.1.tgz","fileCount":7,"integrity":"sha512-TYde5jwWYiIB9gZrzmZNqniKTFVG5PS0jHC2MsHtbRtvyw4XTJ9rQPWZmk3ey+D8wG3CenZaWFjJRt65U3hWzw==","signatures":[{"sig":"MEUCIBWmUF3H1PWg1RRFdWyFAfYZFpbOzZV0j5PEee9Bkyc9AiEAkPc1Z5ziCRIsqELZ4jhVDGT1uJWYVNLNU/PvyvDaM9U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8740},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"cc69ce99742bd86f7620809d75a53fba7c648d4a","scripts":{"lint":"biome lint","test":"bun test","build":"tsup","format":"biome format --write .","prepare":"husky","release":"bun run build && changeset publish","version":"changeset version","preflight":"bun install && bun run format && bun run lint && bun run test && bun run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"},"repository":{"url":"git+https://github.com/asmelabs/olib.git","type":"git"},"_npmVersion":"10.8.2","description":"An SDK for the OpenLibrary platform","directories":{},"lint-staged":{"*.{ts,js}":["biome check --write ."]},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","husky":"^9.1.7","@types/bun":"^1.3.9","lint-staged":"^16.2.7","@biomejs/biome":"^2.3.14","@changesets/cli":"^2.29.8","@changesets/changelog-github":"^0.5.2"},"peerDependencies":{"zod":"^4","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/olib_0.0.1_1770794805953_0.32407894407036175","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@asmelabs/olib","type":"module","version":"0.1.0","description":"An SDK for the OpenLibrary platform","author":{"name":"Mehdi Asadli","email":"asadlimehdi25@gmail.com"},"license":"MIT","homepage":"https://github.com/asmelabs/olib#readme","repository":{"type":"git","url":"git+https://github.com/asmelabs/olib.git"},"bugs":{"url":"https://github.com/asmelabs/olib/issues"},"keywords":["olib","open-library","books","authors","sdk","typescript","javascript"],"main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"scripts":{"prepare":"husky","release":"bun run build && changeset publish","version":"changeset version","build":"tsup","format":"biome format --write .","lint":"biome lint","test":"bun test","typecheck":"tsc --noEmit","preflight":"bun install && bun run format && bun run lint && bun run test && bun run build"},"lint-staged":{"*.{ts,js}":["biome check --write ."]},"devDependencies":{"@biomejs/biome":"^2.3.14","@changesets/changelog-github":"^0.5.2","@changesets/cli":"^2.29.8","@types/bun":"^1.3.9","husky":"^9.1.7","lint-staged":"^16.2.7","tsup":"^8.5.1"},"peerDependencies":{"typescript":"^5","zod":"^4"},"_id":"@asmelabs/olib@0.1.0","gitHead":"c7d3e7fb1ff9dde439009bc078fc92b67cf9bf83","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-o9JRUabJZU4kPzVD1mj3qnm82slU8wEsNAHvpLzRH7hf7Aj/99/R0Ibruhz4t2MLiDbgYO2rV2IPQ9iw+hlOiw==","shasum":"f133badadf1ddc064ef7026887fab833115bb17b","tarball":"https://registry.npmjs.org/@asmelabs/olib/-/olib-0.1.0.tgz","fileCount":7,"unpackedSize":38706,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDn/xrZh+JyKegimdjUHMXR/KOPnxQ5B60eQgBr3V9uYwIhAIW9Wz6Ez/NrMBrWvdhNSX8sfwX2UnOVUvrBSNEzQ9Ta"}]},"_npmUser":{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"},"directories":{},"maintainers":[{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/olib_0.1.0_1770807326691_0.9860586125116308"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T06:21:33.903Z","modified":"2026-02-11T10:55:26.963Z","0.0.0":"2026-02-11T06:21:34.187Z","0.0.1":"2026-02-11T07:26:46.118Z","0.1.0":"2026-02-11T10:55:26.837Z"},"bugs":{"url":"https://github.com/asmelabs/olib/issues"},"author":{"name":"Mehdi Asadli","email":"asadlimehdi25@gmail.com"},"license":"MIT","homepage":"https://github.com/asmelabs/olib#readme","keywords":["olib","open-library","books","authors","sdk","typescript","javascript"],"repository":{"type":"git","url":"git+https://github.com/asmelabs/olib.git"},"description":"An SDK for the OpenLibrary platform","maintainers":[{"name":"mehdiasadli","email":"asadlimehdi25@gmail.com"}],"readme":"# @asmelabs/olib\n\nA type-safe TypeScript SDK for the [Open Library API](https://openlibrary.org/developers/api).\n\n> **Status:** Work in progress 🚧\n\n## Why?\n\nOpen Library is an incredible open-source project — a free, editable catalog aiming to have one web page for every book ever published. But working with its API in TypeScript is painful:\n\n- **No type safety.** Response shapes are undocumented, inconsistent, and polymorphic. A `description` field might be a `string` or `{ type: string; value: string }`. Good luck.\n- **No official TypeScript SDK.** There's a Python client, but nothing for the JS/TS ecosystem.\n- **Verbose and scattered docs.** You end up reading source code to understand what you'll actually get back.\n\n`@asmelabs/olib` fixes all of that — Zod-validated responses, normalized types, and a clean API surface.\n\n## Install\n\n```bash\n# bun\nbun add @asmelabs/olib\n\n# npm\nnpm install @asmelabs/olib\n\n# yarn\nyarn add @asmelabs/olib\n\n# pnpm\npnpm add @asmelabs/olib\n```\n\n## Quick Start\n\n```ts\nimport { createOlibClien } from \"@asmelabs/olib\";\n\nconst ol = createOlibClien();\n\n// Search for books\nconst results = await ol.search(\"Fantastic Mr Fox\");\n\n// Get a work by its Open Library ID\nconst work = await ol.works.get(\"OL45804W\");\n\n// Get an edition by ISBN\nconst edition = await ol.editions.getByISBN(\"9780140328721\");\n\n// Get an author\nconst author = await ol.authors.get(\"OL34184A\");\n\n// Build a cover image URL\nconst coverUrl = ol.covers.book(\"9780140328721\", \"isbn\", \"M\");\n// => \"https://covers.openlibrary.org/b/isbn/9780140328721-M.jpg\"\n```\n\n## Features\n\n- 🔒 **Type-safe** — Full TypeScript types for all endpoints, powered by Zod schemas\n- ✅ **Runtime validation** — Responses are parsed and validated at runtime, not just at compile time\n- 🌐 **Universal** — Works in Node.js, Bun, Deno, and browsers (uses `fetch`)\n- 📦 **Tree-shakeable** — ESM-first, import only what you need\n- 🧩 **Normalized responses** — Polymorphic fields like `description` are normalized to consistent types\n- 📖 **Covers helper** — URL builder for book covers and author photos without extra API calls\n\n## API Coverage\n\n| Module       | Endpoints                                | Status |\n| ------------ | ---------------------------------------- | ------ |\n| **Search**   | Books, Authors, Subjects                 | ✅     |\n| **Works**    | Get, Editions, Ratings, Bookshelves      | ✅     |\n| **Editions** | Get, by ISBN                             | ✅     |\n| **Authors**  | Get, Works                               | ✅     |\n| **Covers**   | Book covers, Author photos (URL builder) | ✅     |\n| **Subjects** | Get                                      | ✅     |\n\n## Docs\n\n→ Full documentation coming soon.\n\n## Requirements\n\n- TypeScript ≥ 5.0\n- A `fetch`-compatible runtime (Node 18+, Bun, Deno, modern browsers)\n\n## Contributing\n\nContributions are welcome! Please read the [Contributing Guide](./CONTRIBUTING.md) before submitting a PR.\n\n## License\n\n[MIT](./LICENSE)\n\n## Credits\n\nBuilt and maintained by Asme Labs.\n\nOpen Library is a project of the [Internet Archive](https://archive.org), a 501(c)(3) non-profit.\n","readmeFilename":"README.md"}