1.0.1 • Published 2 years ago

yehor-bohomazov-sdk v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

yehor-bohomazov-sdk

Install

$ npm install yehor-bohomazov-sdk

or

$ yarn add yehor-bohomazov-sdk

Usage:

Get all books

import { getBookChapters, getBookItem, getBooks } from "yehor-bohomazov-sdk";

const request = async () => {
  const books = await getBooks();
  const booksList = books.docs;
  return booksList;
}

Get one book

const request = async (id) => {
  const book = await getBookItem(id);
  const booksList = books.docs;
  return booksList[0];
}

Get book chapters

const request = async (id) => {
  const bookChapters = await getBookChapters(id);
  const bookChaptersList = books.docs;
  return bookChaptersList;
}

Pagination params

const chapters = await getBookChapters(id, { sort: 'chapterName:desc', page: 2, offset: 10, limit: 100 });

Tested with create-react-app application

1.0.1

2 years ago

1.0.0

2 years ago