1.2.0 • Published 5 years ago

datakick v1.2.0

Weekly downloads
6
License
GPL-3.0
Repository
github
Last release
5 years ago

datakick

dependencies status travis npm version npm downloads coverage Status

Module for making requests to the Datakick API

Installation

npm

npm install datakick --save

unpkg

<script src="https://unpkg.com/datakick@1.2.0/dist/datakick.min.js"></script>

Usage

const datakick = require('datakick');

datakick.item('4335896051932').then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

Features

Get an item by its GTIN

datakick.item('4335896051932').then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

Update an existing item

datakick.update('000000000000', {
  name: 'Test',
  brand_name: 'Test Brand'
}).then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

Add a new item

datakick.add('000000000000', {
  name: 'Test',
  brand_name: 'Test Brand'
}).then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

List the first 100 products

datakick.list().then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

List all items of a specific page

datakick.page('20').then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

Search for items

datakick.query('peanut butter').then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

Upload an image

datakick.image('000000000000', 'image.jpg').then(data => {
  console.log(JSON.stringify(data));
}).catch(error => {
  console.log(error.message);
});

License

GPL-3.0

1.2.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago