Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

luu

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luu

A Node.js client library for the University of Waterloo's API.

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

luu

Latest Stable Version License

A Node.js client library for the University of Waterloo's Open Data API.

Installation

npm install --save luu

Usage

Import the Client from luu.

import { Client } from 'luu';

const client = new Client('YOUR_API_KEY');

Make a request.

// request() returns a promise which resolves to a Fetch Response object
// the client will reject the promise automatically for non 200-level HTTP responses
client.request('foodservices/menu')
  .then(response => response.json())
  .then(console.log)
  .catch(console.error);

You can specify parameters for the endpoint string as well. This library uses sprintf-js to parse the endpoint string. Pre-defined parameterized endpoint strings are exported through Constants.

import { Constants } from 'luu';

client.request(Constants.FS_YEAR_WEEK_MENU, {
  year: 2015,
  week: 2,
}).then(console.log);

// equivalent to
client.request('foodservices/%(year)s/%(week)s/menu', {
  year: 2015,
  week: 2,
}).then(console.log);

// specify an array of parameters
client.request(Constants.FS_YEAR_WEEK_MENU, [2015, 2]).then(console.log);

Keywords

FAQs

Package last updated on 29 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc