npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aeriesjs

v1.1.1

Published

Aeries SIS API NodeJS Helpers

Downloads

11

Readme

aeriesjs

An Aeries SIS (www.aeries.com) API helper library. Helping simplify using the Aeries API with Node applications.

More information on the API can be found here, https://support.aeries.com/support/solutions/articles/14000077926-aeries-api-full-documentation.


Requirements

  • NodeJS 8+ (https://nodejs.org/en/download/)
  • Access to an Aeries SIS API (http://www.aeries.com/)

Usage

Get a list of schools

let api = require('aeriesjs');

var aeries = new api({
    certificate: '477abe9e7d27439681d62f4e0de1f5e1',
    url: 'https://demo.aeries.net/aeries/',
});

console.log('Getting list of schools: ');

aeries.getSchools(function (error, body, code) {
    if (error) {
        console.log('\t', error);
    }
    else {
        for (var i in body) {
            var s = body[i];
            if (s) {
                console.log('\t', s.SchoolCode, ' - ', s.Name);
            }
        }
    }
});

Output

Getting list of schools:
         0  -  Eagle Unified School District
         100  -  ZZZ Basic Code Tables
         200  -  ZZZ Basic Data HS ADS SOC Etc
         990  -  Golden Eagle Elementary School
         991  -  Tawny Eagle YR Elementary School
         992  -  Hawk Elementary for ATT
         993  -  Bald Eagle Intermediate School
         994  -  Screaming Eagle High School
         995  -  Aeries Continuation School
         996  -  Eagle Flight School
         997  -  Eagle Alternative Education School
         998  -  Eagle Summer School
         999  -  ZZZ Inactive Students

Get information about a Course

let api = require('aeriesjs');

var aeries = new api({
    certificate: '477abe9e7d27439681d62f4e0de1f5e1',
    url: 'https://demo.aeries.net/aeries/',
});

console.log('Get Information for course #0618:');
aeries.getCourseDetails('0618', function (error, body, code) {
    if (error) {
        console.log('\t', error);
    }
    else if (body) {
        // If a course id is specified, result is not an array.
        if (!Array.isArray(body)) {
            body = [body];
        }

        for (var i in body) {
            var j = body[i];
            console.log('\t', j.ID, '-', j.Title);
            for (var k in j) {
                if (!k.match(/(title|id)/i)) {
                    console.log('\t  -', k, '-', j[k]);
                }
            }
        }
    }
    else {
        console.log('No information found.');
    }
});

Output

Get Information for course #0618:
         0618 - PreCalculus
          - LongDescription - PreCalculus
          - Notes -
          - ContentDescription -
          - NonAcademicOrHonorsCode -
          - SubjectArea1Code - D
          - SubjectArea2Code - J
          - SubjectArea3Code -
          - DepartmentCode - M
          - StateCourseCode - 2498
          - CSFCourseList - A
          - CollegePrepIndicatorCode - P
          - CreditDefault - 5
          - CreditMax - 10
          - TermTypeCode - Y
          - LowGrade - 10
          - HighGrade - 12
          - CSU_SubjectAreaCode - C
          - CSU_Rule_CanBeAnElective - G
          - CSU_Rule_HonorsCode -
          - UC_SubjectAreaCode - C
          - UC_Rule_CanBeAnElective - G
          - UC_Rule_HonorsCode -
          - PhysicalEducationIndicator - false
          - InactiveStatusCode -

Real World - Creating a student CSV Export

'use strict';

let api = require('aeriesjs');
let csv = require('csv-write-stream');
let fs = require('fs');

var aeries = new api({
    certificate: '477abe9e7d27439681d62f4e0de1f5e1',
    url: 'https://demo.aeries.net/aeries/',
});

console.log('Creating student export CSV file for students at school 990...');
aeries.getStudents(990, function (err, students, code) {
    if (err) {
        console.log(err);
    }
    else {
        if (students && students.length > 0) {

            var writer = csv({
                separator: '^',
                newline: '\r\n',
                sendHeaders: true
            });
            writer.pipe(fs.createWriteStream('students.csv'));

            var count = 0;

            for (var i in students) {
                var s = students[i];
                if (s) {
                    writer.write(s);
                    count++;
                }
            }

            writer.end();

            console.log('Wrote ' + count + ' students to file "students.csv".');
        }
        else {
            console.log('No students found.');
        }
    }
});

Output

Creating student export CSV file for students at school 990...
Wrote 739 students to file "students.csv".

Configuration

The configuration takes the URL of the Aeries API, the security certificate and an option to disable SSL verification.

You can change the certificate or url using the setCertificate and setUrl functions as well.

var options = {
    certificate: '477abe9e7d27439681d62f4e0de1f5e1',
    url: 'https://demo.aeries.net/aeries/',
    verifyCerts: true
};

Usage

let api = require('aeriesjs');

var aeries = new api({
    certificate: '477abe9e7d27439681d62f4e0de1f5e1',
    url: 'https://demo.aeries.net/aeries/',
    verifyCerts: false // disable SSL verification
});
let api = require('aeriesjs');

var aeries = new api({
    verifyCerts: false // disable SSL verification
});

aeries.setCertificate('477abe9e7d27439681d62f4e0de1f5e1');
aeries.setUrl('https://demo.aeries.net/aeries/');

Callbacks

All functions implement a basic callback function to process the returned error or data. The callback includes an error, the response body and an HTTP status code.

aeries.getSchools(function(error, responseBody, responseCode) {
    
});