Skip to main content

📚use-book

📚 use-book is a hook that lets you get product info from url or book cover in React.

build passin license MITnpm package twitter URL

Table of Contents​

Install via npm​

npm i use-book

Quick started​

git clone github.com/tseijp/use-book
cd use-book
npm i
npm start

Simple example​

import React from 'react'
import { useBook } from 'use-book'

export function App() {
const book = useBook('https://amazon.com/xxx/dp/xxx')
return <img {...book.img} />
}

Available hooks​

HookDescription
useBookget amazon data from url

Performance pitfalls​

URL

valuehttps://{HOST}/images/P/{ASIN/ISBN}.{COUNTRY}.{SIZE}
HOSTimages-na.ssl-images-amazon.com or images-jp.amazon.com
ISBNInternational Standard Book Number
ASINAmazon Standard Identification Number
COUNTRYJapan:09

SIZE

valuemeanw*h sizebook sizenotes
THUMBZZZsamnale75Ă—7552Ă—75
TZZZZZZZsmall110Ă—11077Ă—110
MZZZZZZZmiddle160Ă—160112Ă—160
LZZZZZZZlarge500Ă—500349Ă—500if h<500, return Full size image