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

dimigo

v1.0.2

Published

Dimigo REST API wrapper for Node.js

Downloads

4

Readme

node-dimigo

npm v npm dt node v npm l

Dimigo REST API wrapper for Node.js

Installation

$ npm install dimigo

API Reference

  • Dimigo
    • constructor
      • new Dimigo(opts)
    • static
      • .createHash(password) ⇒ String
    • instance
      • .identifyUser(username, password, [hash]) ⇒ Object
      • .getStudent(username) ⇒ Object
      • .getTeacher(username) ⇒ Object

Dimigo

new Dimigo(opts)

Create a new API wrapper.

| Param | Type | Description | | ----- | ----- | ----- | | opts | Object | | | opts.host | String | URL of Dimigo REST API server | | opts.username | String | Username for HTTP Basic Authorization | | opts.password | String | Password for HTTP Basic Authorization |

Dimigo.createHash(password)

Calculate the Dimigo hash value of a password.

| Param | Type | Description | | ----- | ----- | ----- | | password | String | Password to be hashed |

Return value ⇒ String

the Dimigo hash of the password

Dimigo hashing algorithm
'@' + sha256(password + sprintf('%010u', crc32(password)))

api.identifyUser(username, password, [hash])

Authenticate and get a data of the user.

| Param | Type | Description | | ----- | ----- | ----- | | username | String | Username of Dimigo account | | password | String | Password of Dimigo account | | hash | Function | Hash function (default: Dimigo.createHash) |

Return value ⇒ Object

The user data from Dimigo REST API.

| Key | Type | Description | | ----- | ----- | ----- | | id | int | Primary key | | username | String | Unique | | email | String | | | name | String | Korean name | | nick | String? | User-specific name | | gender | String | M: male, F: female, NULL: unknown | | userType | char | S: students, T: teachers, D: dormitory teachers, P: parents, O: others | | birthday | String? | YYYY-MM-DD | | status | int | 10 for active, 0 for deactivated | | facePhoto | String? | Image URL for face image | | userPhoto | String? | Image URL for user-specific image | | createdAt | String | YYYY-MM-DD HH:mm:ss | | updatedAt | String | YYYY-MM-DD HH:mm:ss | | passwordHash | String? | Not available | | ssoToken | String? | SSO token for student.dimigo.hs.kr

api.getStudent(username)

Get a data of enrolled student.

| Param | Type | Description | | ----- | ----- | ----- | | username | String | Username of Dimigo student account |

Return value ⇒ Object

The student data from Dimigo REST API.

| Key | Type | Description | | ----- | ----- | ----- | | id | int | Primary key | | username | String | Unique | | name | String | Korean name | | gender | String | M: male, F: female, NULL: unknown | | grade | int | Current grade (1 to 3) | | clazz | int | Current class (1 to 6) | | number | int | Current number in class | | serial | String | Serial code (e.g. 2409) | | rfcardUid | String | RFID UID of student ID card | | facePhoto | String? | Image URL for face image | | userPhoto | String? | Image URL for user-specific image | | dormitory | String? | Current dormitory (학봉관, 본관 or null) | | roomNum | String? | Current dormitory room number (~3 digits) |

api.getTeacher(username)

Get a data of the teacher.

Return value ⇒ Object

The teacher data from Dimigo REST API.

| Key | Type | Description | | ----- | ----- | ----- | | id | int | Primary key | | username | String | Unique | | name | String | Korean name | | gender | String | M: male, F: female, NULL: unknown | | position | String? | e.g. 부장교사, 교사, 교감, 교장 | | role | String? | e.g. 담임, 비담임, 1학년부장, IT특성화부장, 교무부장 | | grade | int? | Current grade (1 to 3, if role is 담임 or 부담임) | | clazz | int? | Current class (1 to 6, if role is 담임 or 부담임) |