1.1.0 • Published 2 years ago

icowatchlist v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

icowatchlist

A simple Node.js API wrapper for icowatchlist.com

Installation

npm install icowatchlist

Usage

Initializing


const ICOWatchlist = require('icowatchlist');

API Examples

The wrapper returns a promise for all request types, so you can use Promise.then() or async/await to get the results

// Get all ICOs
ICOWatchlist.getAll();

// Get Live ICOs only
ICOWatchlist.getLive();

// Get Upcoming ICOs only
ICOWatchlist.getUpcoming();

// Get Finished ICOs only
ICOWatchlist.getFinished();


// Use with Promise.then()

ICOWatchlist.getLive().then(function(response) {
  // print name of first Live ICO
  console.log(response[0].name);
});


// Use with async function 

(async function() {
  let allICOs =  await ICOWatchlist.getAll();
  // Print array of the upcoming ICOs 
  console.log(allICOs.upcoming);
})();

API Reference

This table maps the original API to the wrapper functions and their results.

Original APIWrapperResult
/public/v1/ICOWatchlist.getAllObject: {"live": ..., "upcoming": ..., "finished": ...}
/public/v1/liveICOWatchlist.getLiveArray
/public/v1/upcomingICOWatchlist.getUpcomingArray
/public/v1/finishedICOWatchlist.getFinishedArray