Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including upc-database with all npm packages installed. Try it out:

// Switch node version to Node6 var UPC = require('upc-database'); var upc = new UPC('your key'); upc.json('0111222333446', function(resp){ if(!resp.serverError && resp.valid){ console.dir(resp); } else if(!resp.serverError && !resp.valid){ console.log(resp.reason); } else { console.log('server error'); } }); upc.xml('0111222333446', function(resp){ if(!resp.serverError && resp.valid){ console.dir(resp); } else if(!resp.serverError && !resp.valid){ console.log(resp.reason); } else { console.log('server error'); } });

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

upc-database v1.0.4

API wrapper for the UPCDatabase (upcdatabase.org)

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free