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

judgekit

v0.0.7-hotfix5

Published

various of toolCLI for code judge, exam, test, etc.

Downloads

1

Readme

typescript license GitHub Repo stars

Node.js Package Discord

- 한국어 -

the CLI node module for JS code judge quick testing.

Judgekit is made for easy code generation and quick code testing. With this module, every time you test code a new node process is created for running the given script file. You don't need to change any configuration after editing the script file while testing - just press the enter key in the termial!

notice
this modules is based on my tester.js gist. most things in there are same in here too, but it's not a bad choice to see the gist.

Installation

because it is CLI modules, i strongly suggest to install in global.

yarn global add judgekit
npm install -g judgekit

Features

base comamnd is judgekit. every arguments, options, subcommands are based on this command.
first of all, you can see all comamnd and CLI information via judgekit --help command.

Test script

you can run special javascript file by running test command as below examples.

judgekit test <script[.js]>
judgekit test 1000
judgekit test 1000.js

because only javascript is valid in this CLI, you don't have to type .js extension yourself as you see above command. also you don't have to restart CLI when changing script file. why? because script processor is re-created everytime you continue test.
everytime processor is created, it load latest script codes again and again. so you don't have to restart anything anymore.

+ because of this feature, you also don't have to restart CLI when changing testcase hjson file too.

Test script with Test Case

to load special script file and run testcase datas automatically, you can use -TC options as you see below examples.

judgekit test <script[.js]> -TC
judgekit test <script[.js]> --testcase
judgekit test <script[.js]> --testcase customHJSON.hjson

as you see, if you have custom file you can also use it. the default testcase file's name is testcase.hjson.

notice that -tc flag is not valid. ~~yeah i know this is weird...~~

Test Case

the testcase file is designed for automatically input. you can see example format in here

Test case can be three format - json, hjson, yaml.

testcase.hjson is default file of TestCase. you can customize the name and use to --testcase flag's value. at least, it be in CMD path (current terminal path).

Code Generation (WIP)

tired about typing same codes everytime start code exam or judge problems?
code generation command will copy-paste boilerplate codes from templates/ directory.

the comamnd format is same as below examples.

judgekit generate <script_name[.js]> [template_script_name[.js]] [-O outdir]
judgekit generate examples/1000
judgekit generate 1000 -O examples

notice
currently you can use only one template - readline_ex.js, but i will add more template scripts and support custom template via command argument.

Config

Judge judgekit CLI accepts config file called kitconfig.json.
the config file will be automatically generated in user's home directory - also if there is config file in project root, cli will load it. the config file is used for some CLI config or option cache. for example with judgekit test 1000 -TC specialTestCase.json command, the Config will write this in config file. so after setting options, you don't need to call twice. like

judgekit test 1000 -TC testcase.yaml
judgekit test 1000 -TC

format

the config file is same as below default configs.

{
  "currentLang": "en",
  "testcasePath": "testcase.hjson",
  "templatePath": "readline_ex.js",
  "generatePath": "src"
}

Config Command

also for some config you can set it by judgekit config.
currently you can use it only for currentLang config.

judgekit config -L en
judgekit config --lang ko

TODO

  • [x] Internationalize Project
    • [x] support english CLI
    • [x] support korean README
  • [x] support json/yaml testcase format too
  • [ ] support pre-run input mapper scripts
  • [ ] improve code generation
    • [x] add some code generation templates
    • [ ] more built-in code templates and choose prompt
  • [ ] support test code(jest?)