# @types/node-isbn

> TypeScript definitions for node-isbn

Latest version **1.6.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/node-isbn
pnpm add @types/node-isbn
yarn add @types/node-isbn
bun add @types/node-isbn
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.6.4 |
| Published | 2023-11-07 |
| First published | 2020-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/node-isbn
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-isbn
- npm.io page: https://npm.io/package/@types/node-isbn

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 1.6.4 (latest) — 2023-11-07
- 1.6.2 (ts3.6) — 2021-07-08
- 1.6.1 (ts3.5) — 2021-05-13
- 1.6.0 (ts3.0) — 2020-08-19
- 1.6.3 — 2023-10-18

## README

# Installation
> `npm install --save @types/node-isbn`

# Summary
This package contains type definitions for node-isbn (https://github.com/palmerabollo/node-isbn#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-isbn.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-isbn/index.d.ts)
````ts
/// <reference types="node" />
import { AxiosRequestConfig } from "axios";

declare namespace isbn {
    interface Isbn {
        PROVIDER_NAMES: typeof PROVIDER_NAMES;

        /**
         * Provider API that gets chained before `resolve`. If this is specified, the
         * `resolve` fn will honor this order.
         *
         * @param providers - Array of providers. Must be one of more from `isbn.PROVIDER_NAMES`
         *
         * @example
         *
         * ```
         * isbn
         *  .provider([isbn.PROVIDER_NAMES.OPENLIBRARY, isbn.PROVIDER_NAMES.GOOGLE])
         *  .resolve(...)
         * ```
         */
        provider(providers: Providers): this;

        /**
         * Resolves book info, given an isbn
         * @param isbn
         */
        resolve(isbn: string, options: AxiosRequestConfig, callback?: ResolveCallback): void;
        resolve(isbn: string, options?: AxiosRequestConfig): Promise<Book>;
        resolve(isbn: string, callback: ResolveCallback): void;
    }

    const PROVIDER_NAMES: {
        GOOGLE: "google";
        OPENLIBRARY: "openlibrary";
        WORLDCAT: "worldcat";
        ISBNDB: "isbndb";
    };

    type Provider = typeof PROVIDER_NAMES[keyof typeof PROVIDER_NAMES];
    type Providers = Provider[];

    type BookLanguage = "en" | "es" | "fr" | "unknown";

    interface ResolveCallback {
        (error: Error | null, book: Book): void;
    }

    interface Book {
        authors: string[];
        categories: string[];
        description?: string | undefined;
        imageLinks?: {
            smallThumbnail: string;
            thumbnail: string;
        } | undefined;
        industryIdentifiers: string[];
        infoLink: string;
        language: BookLanguage;
        pageCount?: number | undefined;
        previewLink: string;
        printType: "BOOK";
        publishedDate: string;
        publisher: string;
        title: string;
    }
}

/**
 * A simple node.js module that resolves books by ISBN using multiple services:
 * - Google Books API
 * - Open Library Books API
 * - WorldCat xISBN API
 * - ISBNdb API using API key in the environment variable ISBNDB_API_KEY
 *
 * @see {@link https://github.com/palmerabollo/node-isbn#examples}
 */
declare const Isbn: isbn.Isbn;

export = Isbn;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [axios](https://npmjs.com/package/axios)

# Credits
These definitions were written by [Piotr Błażejewicz](https://github.com/peterblazejewicz).

---
_Source: https://npm.io/package/@types/node-isbn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
