zerocater-node
Node.js client for Zerocater.
So far there is only 1 method for accessing ZeroCater's information because the API is undocumented, but there will slowly be more to come!
Getting started
- Install and save the package
npm i -S zerocater
- Import the package
; // ES6// ORvar ZeroCater = ; // ES5
- Instantiate the class
Zerocater([ZeroCater shortcode])
// If your url is `https://zerocater.com/m/XXXX`, `XXXX` is your shortcodeconst zc = ;
Methods
getMeals
By default returns an array of all meals linked to your account. Accepts an
object with optional range
and timeFormat
properties.
const allMeals = zc; // An array of all the meals past and present attached to your account
range
can be a predefined string or a custom range object like below:
// Accepts one of these predefined strings: 'month', 'week', 'yesterday', 'today', 'tomorrow'const tomorrowMeal = zc;// OR// Custom start and end rangeconst twoDaysOfMeals = zc;
timeFormat
must be a string that can be parsed by
moment
:
const singleMeal = zc;console // Monday, April 25th 2016
More to come...