### Install isbndb-client Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Install the isbndb-client package using npm or yarn. ```bash npm install isbndb-client # or yarn add isbndb-client ``` -------------------------------- ### Quick Start: Initialize and Use ISBNdb Client Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Initialize the client with an API key and subscription plan, then use it to search for books, get book details, or search for authors. ```typescript import { createIsbndbClient, IsbndbService } from 'isbndb-client'; // Create a client with your API key const client = createIsbndbClient('YOUR_API_KEY', 'PRO'); // 'BASIC', 'PREMIUM', or 'PRO' const isbndb = new IsbndbService(client); // Search for books const searchResults = await isbndb.searchBooks('javascript'); console.log(searchResults.data.books); // Get book details by ISBN const bookDetails = await isbndb.getBook('9780131103627'); console.log(bookDetails.data.book); // Search for authors const authorResults = await isbndb.searchAuthors('Martin Fowler'); console.log(authorResults.data.authors); ``` -------------------------------- ### Run All Tests Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Execute the comprehensive test suite for the isbndb-client project using npm. ```bash npm test ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Execute the test suite and generate a code coverage report using npm. ```bash npm run test:coverage ``` -------------------------------- ### General Operations Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md General utility operations for the ISBNdb API. ```APIDOC ## searchIndex(index: "subjects" | "publishers" | "authors" | "books", options?: IndexSearchOptions) ### Description General search across specified indexes. ### Method `searchIndex` ### Parameters #### Path Parameters - **index** (string) - Required - The index to search within (e.g., "subjects", "publishers", "authors", "books"). - **options** (IndexSearchOptions) - Optional - Additional search options. ``` ```APIDOC ## getStats() ### Description Get database statistics. ### Method `getStats` ``` -------------------------------- ### Handle API Errors Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Catch and log errors when interacting with the ISBNdb API, such as when a book is not found. ```typescript try { await isbndb.getBook('invalid-isbn'); } catch (error) { console.error(error); // { // status: 404, // statusText: 'Not Found', // message: 'Book not found', // url: '/book/invalid-isbn' // } } ``` -------------------------------- ### Publisher Operations Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Operations for retrieving and searching publisher information. ```APIDOC ## getPublisher(name: string, options?: PublisherDetailOptions) ### Description Get publisher details and their books. ### Method `getPublisher` ### Parameters #### Path Parameters - **name** (string) - Required - The name of the publisher. - **options** (PublisherDetailOptions) - Optional - Additional options for retrieving publisher details. ``` ```APIDOC ## searchPublishers(query: string, options?: PublisherSearchOptions) ### Description Search for publishers. ### Method `searchPublishers` ### Parameters #### Path Parameters - **query** (string) - Required - The search query for publishers. - **options** (PublisherSearchOptions) - Optional - Additional search options. ``` -------------------------------- ### Author Operations Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Operations for retrieving and searching author information. ```APIDOC ## getAuthor(name: string, options?: AuthorDetailOptions) ### Description Get author details and their books. ### Method `getAuthor` ### Parameters #### Path Parameters - **name** (string) - Required - The name of the author. - **options** (AuthorDetailOptions) - Optional - Additional options for retrieving author details. ``` ```APIDOC ## searchAuthors(query: string, options?: AuthorSearchOptions) ### Description Search for authors by name. ### Method `searchAuthors` ### Parameters #### Path Parameters - **query** (string) - Required - The search query for author names. - **options** (AuthorSearchOptions) - Optional - Additional search options. ``` -------------------------------- ### Book Operations Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Operations related to retrieving and searching for book information. ```APIDOC ## getBook(isbn: string, withPrices?: boolean) ### Description Get book details by ISBN. ### Method `getBook` ### Parameters #### Path Parameters - **isbn** (string) - Required - The ISBN of the book to retrieve. - **withPrices** (boolean) - Optional - Whether to include pricing information. ### Response #### Success Response (200) - **data.book** (object) - Detailed information about the book. ``` ```APIDOC ## searchBooks(query: string, options?: BookSearchOptions) ### Description Search for books by keyword. ### Method `searchBooks` ### Parameters #### Path Parameters - **query** (string) - Required - The search query string. - **options** (BookSearchOptions) - Optional - Additional search options. ``` -------------------------------- ### Subject Operations Source: https://github.com/krister-johansson/isbndb-client/blob/main/README.md Operations for retrieving and searching subject classifications. ```APIDOC ## getSubject(name: string) ### Description Get subject details. ### Method `getSubject` ### Parameters #### Path Parameters - **name** (string) - Required - The name of the subject. ``` ```APIDOC ## searchSubjects(query: string, options?: SubjectSearchOptions) ### Description Search for subjects. ### Method `searchSubjects` ### Parameters #### Path Parameters - **query** (string) - Required - The search query for subjects. - **options** (SubjectSearchOptions) - Optional - Additional search options. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.