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 🙏

© 2026 – Pkg Stats / Ryan Hefner

juno-erp-client

v1.1.1

Published

A high-level TypeScript API wrapper for the JUNO Campus ERP platform, supporting automated login and session persistence.

Readme

Juno ERP Client

npm version License: MIT

A high-level TypeScript API wrapper for the JUNO Campus ERP system (MGM University). It simplifies programmatic access from both the student and employee/management sides — student profile, attendance, results, fees, timetable, and the employee-side student-management dashboard.

Features

  • 🔐 Automated Authentication: Handles the multi-step Juno login (JSESSIONID acquisition, session priming). Login is identical for students and employees — the server resolves the role from the credentials.
  • 👥 Two clients, shared core: StudentClient and EmployeeClient both extend a common base that owns login and session management.
  • 💾 Session Persistence: Save/load cookies to a file, or export/import them manually (for serverless/DB storage).
  • 🌐 Proxy support: Route traffic through an HTTP/HTTPS or SOCKS proxy.
  • 📘 Type Safe: Written in TypeScript with interfaces for all API responses.

Installation

npm install juno-erp-client

Clients at a glance

| Export | Use it for | | --- | --- | | StudentClient | A logged-in student accessing their own data. | | EmployeeClient | A logged-in employee/staff member, including the student-management dashboard. | | JunoBaseClient | Abstract base (login + session). You normally don't use this directly. | | JunoClient | The shared client interface (type), and a deprecated value alias of StudentClient for backward compatibility. |

Backward compatibility: import { JunoClient } still works and constructs a StudentClient. It is deprecated — prefer StudentClient.

Quick Start

Student

import { StudentClient } from 'juno-erp-client';

const client = new StudentClient({ debug: true });

if (await client.login('your_username', 'your_password')) {
    const profile = await client.getStudentProfile();
    console.log(`Logged in as: ${profile[0].firstName} ${profile[0].lastName}`);

    const attendance = await client.getAttendanceDetails();
    console.log(attendance.AttendaceDetailsJObject.percent + '% attendance');
}

Employee / student management

import { EmployeeClient } from 'juno-erp-client';

const client = new EmployeeClient();
await client.login('employee_username', 'employee_password');

// University-wide search (staff + students). Each hit is a discriminated union.
const results = await client.search('Khan');
for (const hit of results) {
    if (hit.resultType === 'Student') {
        const info = await client.getStudentPersonalInformation(Number(hit.studentId));
        console.log(info.PersonalInfo.fullName, info.PersonalInfo.mobile);
    }
}

Configuration

new StudentClient({
    baseUrl: 'https://erp.mgmu.ac.in',      // default
    debug: false,                           // verbose logging
    sessionPath: './.session/cookies.json', // persist cookies to a file
    autoSave: true,                         // save session after login (default: true if sessionPath set)
    proxy: {                                // optional
        protocol: 'http',                   // 'http' | 'https' | 'socks4' | 'socks5'
        host: '127.0.0.1',
        port: 8080,
        auth: { username: 'u', password: 'p' }, // optional
    },
});

Session persistence

// File-based: reuse a session across runs
const client = new StudentClient({ sessionPath: './.session/cookies.json' });
if (!(await client.isLoggedIn())) {
    await client.login(username, password);
}

// Manual export/import (e.g. store in Redis or a DB)
const data = client.exportSession();
const restored = new StudentClient();
restored.importSession(data);

Note: EmployeeClient.isLoggedIn() is not yet reliable — the employee session-probe endpoint hasn't been confirmed, so it may always report false and trigger a re-login. StudentClient.isLoggedIn() works as expected.

Proxy helpers

parseProxyUrl and buildProxyAgent are exported for convenience:

import { parseProxyUrl } from 'juno-erp-client';
const proxy = parseProxyUrl('socks5://user:pass@host:1080');
const client = new EmployeeClient({ proxy });

API overview

StudentClient (own data)

  • Profile: getStudentProfile, getPersonalInformation, getAcademicInfo, getAdmissionDetails, getAllCastes, getCountryList
  • Courses & Attendance: getCourses, getAttendanceDetails, getAttendanceGraph
  • Results & Exams: getStudentResults, getExamDetails
  • Finance: getFeesDetails, getFeeStructureByStudentId, getFeeStructureByStudentIdOfStudentSide, getStudentReceivable
  • Schedule: getTodaySchedule, getTimetableBetweenDates
  • Other: search, getStudentIdFromSession, getTransferDetails, getTransferDetailsOfStudent, getProfilePicture, getProfilePictureUrl

EmployeeClient

  • Search: search (university-wide; returns Employee or Student hits)
  • Student management (by studentId): getStudentPersonalInformation, getStudentAcademicInfo, getStudentAdmissionDetails, getStudentFeesDetails, getStudentFeeStructure, getStudentReceivable, getStudentAttendanceDetails, getStudentAttendanceGraph, getStudentMarksGraph, getStudentClinicalAttendanceAnalysis, getStudentExamDetails, getStudentTransferDetails, getStudentTransferHistory, getStudentEventDetails, getStudentGrievances, getStudentLibraryDetails, getStudentPlacementDetails, getStudentHostelDetails, getStudentCourseFileDetails, getStudentLeaveHistory

All methods return strongly typed promises. Refer to the TypeScript definitions for response structures.

Development

npm run build     # compile TypeScript to dist/

Integration tests

The tests/ scripts hit the live ERP, so they need credentials via environment variables or a gitignored .env at the repo root:

JUNO_STUDENT_USERNAME=...    JUNO_STUDENT_PASSWORD=...
JUNO_EMPLOYEE_USERNAME=...   JUNO_EMPLOYEE_PASSWORD=...
JUNO_USERNAME=...            JUNO_PASSWORD=...        # generic fallback for any role
npm run test:login     # employee login + session
npm run test:search    # employee university search
npm run test:student   # employee → student-management endpoints (pass an id, e.g. ... 149963)
npm run test:proxy     # proxy connectivity (set JUNO_TEST_PROXY=<url>)

Troubleshooting

Connectivity

On ECONNREFUSED/ETIMEDOUT, ensure erp.mgmu.ac.in is online and not blocked by a firewall/VPN.

Empty responses

Some endpoints require server-side session "priming", which login() handles. If using persisted sessions, ensure the session hasn't expired on the server.

License

MIT © Denizuh