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

aspen-api

v1.1.2

Published

An API client library for interacting with Aspen, a Student Information System (SIS) created by Follett and used in schools around the U.S.

Downloads

13

Readme

aspen-api

An API client library for interacting with Aspen, a Student Information System (SIS) created by Follett and used in schools around the U.S.

This package is a work-in-progress. Some features may be missing or not fully fleshed-out!

Installation

aspen-api can be installed from NPM with your node package manager of choice:

npm install aspen-api
yarn install aspen-api
pnpm install aspen-api

Note: aspen-api is ESM, rather than CommonJS. That means that if you want to use it in a project written in CommonJS, you need to either convert your project to ESM, or use the import() function.

Usage

You can access Aspen through a single class. You need to initiate it using your 'district ID.' All Aspen instances are hosted at a subdomain of myfollett.com, though some districts might have students use a different domain, for example, aspen.dcps.dc.gov -> dcps.myfollett.com.

import Aspen from "aspen-api";

const aspen = new Aspen("dcps");

Once you've created an Aspen object, you need to log in:

// store your login however you want!
const username = process.env.USERNAME
const password = process.env.PASSWORD

await aspen.login({ username, password })

API

Aspen

Everything in aspen-api is stored in a central Aspen class.

constructor(id: string, cookies? Cookie[])

Constructs a new Aspen object. The id is the subdomain of <id>.myfollett.com. Cookies can be passed in using an array of Cookie objects. aspen-api uses tough-cookie for managing cookies. If you want to save an Aspen session and reconstruct it later, this is the recommended way to do it.

import Aspen from "aspen-api";

const aspen = new Aspen("dcps");

login(options: { username: string, password: string })

Returns: Promise<null>

// store your login however you want!
const username = process.env.USERNAME;
const password = process.env.PASSWORD;

await aspen.login({ username, password });

getClasses()

Returns: Promise<ClassInfo[]>

Gets a list of all the classes, along with info about them.

const classes = await aspen.getClasses();

getClass(token: string)

Returns: Promise<ClassData>

Gets data about a class, including grades. The token is a sort of identifier for the class, it comes in the data from the getClasses function.

// grab this earlier from getClasses()
const token = // ...

const mathClass = await getClass(token);

getAssignments(token: string)

Returns: Promise<Assignment[]>

Gets the list of assignments from a class.

// grab this earlier from getClasses()
const token = // ...

const mathAssignments = await getAssignments(token);

getSchedule()

Returns: Promise<Schedule>

Gets the current schedule of the current student.

getCookies()

Returns: Promise<Cookie[]>

Gets a list of all the stored cookies.

Types

See types.ts.