@knighthacks/hackathon
v0.1.0-dev-d1c83c6
Published
The hackathon backend node API
Downloads
12
Readme
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,
});