🔎 Node.js module for Datakick 🔍
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
index.js
package-lock.json
package.json

README.md

datakick

dependencies Status Travis NPM Version NPM Downloads Coverage Status

NodeJS module for making requests to the Datakick API

Installation

npm install datakick --save

Usage

const datakick = require('datakick');

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

Features

Get an item by its GTIN

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

Update an existing item

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

Add a new item

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

List the first 100 products

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

List all items of a specific page

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

Search for items

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

Upload an image

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

License

GPL-3.0