- Make sure you have Node.js v22 installed.
- Run
npm installto get dependencies. - Run
npm run startto fetch books and see the output. - Run
npm testto run the test suite.
-
This project assumes the JSON response from the book API will be an array where each item contains nested
bookandstockobjects, structured as follows:{ "book": { "title": "Macbeth", "author": "William Shakespeare", "isbn": "123456789" }, "stock": { "quantity": 5, "price": "6.99" } } -
The client maps this response to a simpler object containing only these properties:
{ "title": "Macbeth", "author": "William Shakespeare", "isbn": "123456789", "quantity": 5, "price": "6.99" }