0.1.3 • Published 4 years ago

adafruit.js v0.1.3

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

With Adafruit.JS, you can easily use the Adafruit API to look up information on products, guides, and more!

Install

$ npm install --save adafruit.js

Examples

Product Information

Adafruit.JS has a simple way for returning information on products!

Code:

const adafruit = require('adafruit.js')

adafruit.getProduct('id').then(p => {
    console.log(p)
})

Console:

{ id: 'product-id',
  image: 'product-thumbnail',
  name: 'product-name',
  desc: 'product-name',
  model: 'model or undefined',
  mpn: 'product-mpn',
  category: 'category-id',
  manufacturer: 'manufacturer or null',
  price: 'price',
  currency: 'currency',
  url: 'product-page-link',
  instock: 'product-in-stock (true/false)',
  stock: 'amount in stock',
  discontinued: 'product-discontinued (true/false)',
  discount:
   [ { discounted_price: '5.95',
       discounted_percent: 0,
       show_qty: '1-9',
       min_qty: 1 },
     { discounted_price: '5.36',
       discounted_percent: '10',
       show_qty: '10-99',
       min_qty: 10 },
     { discounted_price: '4.76',
       discounted_percent: '20',
       show_qty: '100+',
       min_qty: 100 } ],
  html:
   'description-in-html' }

Errors:

  • No ID Specified: {"error": "Invalid Identifier"}
  • ID Not a Number: {"error": "NaN"}
  • Product Not Found: {"error": "Product not found"}
  • Unknown Error: {"error": "An unknown error occured"} or undefined
0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago