0.1.0-dev-d1c83c6 • Published 3 years ago

@knighthacks/hackathon v0.1.0-dev-d1c83c6

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

KnightHacks Node API

This package provides a simple interface for interacting with the knighthacks backend

Getting up and running is easy:

import { API } from '@knighthacks/hackathon';

// Create api instance.
const api = new API();

Example: Fetch Club Events

const clubEvents: ClubEvent[] = await api.club.getEvents();

// Dates are automatically serialized.
console.log(clubEvents[0].start.toLocaleString());

Example: Manipulate Hacker Data

const hacker = await api.hackers.get('Bob');

await hacker.setLastName('Joe');
await hacker.setSharingInfo(true);

// Or use a bulk edit...

await hacker.edit({
  lastName: 'Joe',
  canShareInfo: true,
});