1.1.2 • Published 3 years ago

nikel v1.1.2

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

Nikel API for Node.js

npm

Please consult the official Nikel API docs for additional information on query values, and response values.

Install:

npm install nikel

Example Usage:

// TypeScript (highly encouraged)
import {Courses} from 'nikel';

// JavaScript
const {Courses} = require('nikel');

// MongoDB-like syntax (highly encouraged)
new Courses().where({id: {'$in': 'mat135'}}).get()
    .then(res => console.log(JSON.stringify(res, null, 4)));

// Traditional syntax
new Courses().where({id: 'mat135'}).get()
    .then(res => console.log(JSON.stringify(res, null, 4)));

Current list of endpoints

  • Courses
  • Programs
  • Textbooks
  • Exams
  • Evals
  • Food
  • Services
  • Buildings
  • Parking

Methods

Each endpoint has the same set of methods.

where(query): Adds query to the list of existing queries.

limit(integer): Sets the number of items returned to integer.

offset(integer): Sets the offset of the items returned to integer.

get(): Returns a Promise wrapped with the queried items.

reset(): Resets query and also sets meta-data (limit and offset) to defaults.

MongoDB-like Queries

OperatorStringNumerical / Boolean
$eqEqualityEquality
$neInequalityInequality
$inFuzzy SearchN/A
$ltN/ALess than
$lteN/ALess than or equal to
$gtN/AGreater than
$gteN/AGreater than or equal to
$swStarts withN/A
$ewEnds withN/A
$srSerializationN/A

Example:

// Fuzzy search for "mat135" in id for "St. George" campus
{
    id: {'$in': 'mat135'},
    campus: {'$eq': 'St. George'}
}

Traditional Queries

https://docs.nikel.ml/docs/query_guide

Example:

// Fuzzy search for "mat135" in id for "St. George" campus
{
    id: 'mat135',
    campus: '=St. George'
}
1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.0

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago