yalies

0.1.0 • Public • Published

yalies

NPM package summary for yalies

A JavaScript interface to the Yalies API.

Usage

First install with npm or your favorite package manager:

npm install yalies

Import into your project:

const yalies = require('yalies');
// Alternative:
const API = require('yalies').API;
// If you choose this option, simply instantiate the bot as `new API(...)` below.

Instantiate the API by passing your API key:

const api = new yalies.API('api_key')

You'll want to store your in an environment variable or config file of some sort. At any rate, don't commit it to GitHub! :)

Finally, use the people method to query the API, passing an object containing any request criteria you wish, as explained in the Yalies API documentation.

api.people({
    query: 'John',
    filters: {
        school_code: ['YC'],
        college: [
            'Grace Hopper',
            'Davenport'
        ],
        year: [2023, 2024],
        floor: 3,
        leave: [true]
    },
    page: 1,
    page_size: 10
}).then(people => {
    for (let person of people) {
        console.log(person.netid);
    }
});

Feel free to open an issue if you need help!

Author

Erik Boesen

Readme

Keywords

Package Sidebar

Install

npm i yalies

Weekly Downloads

66

Version

0.1.0

License

MIT

Unpacked Size

3.66 kB

Total Files

4

Last publish

Collaborators

  • erikboesen