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

judgiajslib

v1.0.2

Published

Judgia core for judging codes in competitions

Readme

JudgiaJsLib

Judgia core for judging codes in competitions

Installation

Install JudgiaJsLib with npm or yarn easily

npm install judgiajslib
# or
yarn add judgiajslib

Documentations

First of all, we instantiate an object from Judgia class

import Judgia from 'judgiajslib'

const judgia = new Judgia()

Configuration Properties

Now you have these properties to config judge

Property | Type | Description ---------------|------------------|------------------------------------ cppFilePath | string \| null | Path of C++ file you want to judge staticAnswer | string \| null | Static answer for judging scriptPath | string \| null | Python3 script for judging testcase | string \| null | Testcase which you want to give to C++ code

Methods

And you alse have these methods

Method | Arguements | Output | Description ----------------------|----------------------------|---------------------------------------------|-------------------------------------------- compileAndGetStdout | Nothing | Promise<{stderr: string, stdout: string}> | Compiles C++ code and executes it. Should be runned after setting a string value for cppFilePath checkAnswer | caseInensitive?: boolean | Promise<boolean \| null> | Checks output with static answer. If staticAnswer is null, it would run judge script and use it. If both staticAnswer and scriptPath are null it's output would be null. Also running compileAndGetStdout before it is required. If you set caseInensitive arguement to false it would be sencetive to letters. but otherwise it wouldn't.

Read-only Properties

And also read these properties

Property | Type | Description ---------------|------------------|------------------------------------ stderr | string \| null | Contains standard output of C++ code. It's null before you run compileAndGetStdout stdout | string \| null | Contains standard error of C++ code. It's null before you run compileAndGetStdout trimedStdout | string \| null | Contains whitespaceless standard output of C++ code. It's null before you run checkAnswer

Examples

Here's some examples of usage

With Static Answer

const judgia = new Judgia()

judgia.cppFilePath = "/path/to/file.cpp"
judgia.staticAnswer = "ANSWER HERE"
judgia.testcase = "TESTCASES FOR C++ CODE"

judgia.compileAndGetStdout().then(() => {
    judgia.checkAnswer().then(value => {
        console.log(value ? "yes" : "no")
    })
})

With Judge Script

const judgia = new Judgia()

judgia.cppFilePath = "/path/to/file.cpp"
judgia.scriptPath = "/path/to/judge.py"
judgia.testcase = "TESTCASES FOR C++ CODE"

judgia.compileAndGetStdout().then(output => {
    judgia.checkAnswer().then(value => {
        console.log(value ? "yes" : "no");
    })
})

And judge.py is like this:

import sys

def main():
    if len(sys.argv) < 2:
        return
    
    user_output = sys.argv[1].strip()

    testcase_line1 = input() # Get all testcases like in C++
    testcase_line2 = input()
    # ...

    # CHECKING IF OUTPUT IS CORRECT

    print("yes" if output_is_correct else "no")

if __name__ == "__main__":
    main()

License

Copyright (c) 2025 MohammadAli Arjomand. Licensed under MIT License