@rikvanhaaren/ah_shop_api
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@rikvanhaaren/ah_shop_api", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Get products from the AlbertHeijn web store.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -18,8 +18,13 @@ # <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Albert_Heijn_Logo.svg/1200px-Albert_Heijn_Logo.svg.png" alt="AH Logo" width="25"/> AH Shop Api | ||
```jsx | ||
const AHShopClient = require("@rikvanhaaren/ah_shop_api"); | ||
const { AHShopClient } = require("@rikvanhaaren/ah_shop_api"); | ||
const client = new AHShopClient(); | ||
``` | ||
or | ||
```jsx | ||
import { AHShopClient } from "@rikvanhaaren/ah_shop_api"; | ||
const client = new AHShopClient(); | ||
``` | ||
# Getting Started | ||
Get products by name: | ||
## Get products by name: | ||
```jsx | ||
@@ -31,7 +36,5 @@ client.product().getProductByName('Red Bull').then((result) => { | ||
Get products by name with filter: | ||
## Get products by name with filter: | ||
```jsx | ||
const filter: productFilter = { | ||
//sortBy: sortByOption.nutriscore, | ||
//property: [AfdelingOption.nonFood, AfdelingOption.diepvries], | ||
const filter = { | ||
sortBy: "nutriscore", | ||
@@ -47,4 +50,17 @@ property: ["store_department:non-food", "store_department:diepvries"], | ||
``` | ||
or | ||
```jsx | ||
const filter: productFilter = { | ||
sortBy: sortByOption.nutriscore, | ||
property: [AfdelingOption.nonFood, AfdelingOption.diepvries], | ||
page: 1, | ||
size: 10, | ||
} | ||
client.product().getProductByName('Red Bull', filter).then((result) => { | ||
console.log(JSON.stringify(result)); | ||
}); | ||
``` | ||
Get products by id: | ||
## Get products by id: | ||
```jsx | ||
@@ -56,3 +72,3 @@ client.product().getProductByID(4117).then((result) => { | ||
Get url: | ||
## Get url: | ||
```jsx | ||
@@ -66,5 +82,5 @@ client.getURL("/zoeken/api/products/search").then((result) => { | ||
## License | ||
# License | ||
>You can check out the full license [here](https://github.com/RikVanHaaren/ah_shop_api/blob/main/LICENSE) | ||
This project is licensed under the terms of the **MIT** license. |
82
7073
5
64