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

khutzpa

v0.0.1-alpha.17

Published

Node powered, cross-platform, drop-in replacement for Chutzpah.exe

Downloads

13

Readme

khutzpa

Node powered, cross-platform, drop-in replacement for Chutzpah.exe that provides easy access to JavaScript testing with Jasmine, providing both pass/fail test results and code coverage measurements on the command-line and in html formats.

khutzpa provides:

  1. A Mocha reporter for the command line,
  2. A Jasmine stand-alone runner for in-browser test reporting, and
  3. Coverage reports made with Istabul via karma and Jasmine chai (?)
    • (Maybe? Not sure how chai & sinon are running jasmine syntax tests.)

khutzpa is designed to be run from the command line and/or using the Chutzpah Runner for VS Code. Future plans include a Visual Studio Classic extension set.

Amazingly, it seems to mostly work.


Installation & Quickstart

npm install khutzpa -g

(Yes, please install globally. Yes, you'll need to know what npm is.)

Then, to run all tests as defined by a single Chutzpah.json configuration file:

khutzpa /path/to/config/Chutzpah.json /{command}

On the command line, khutzpa currently at least partially supports these legacy options:

  • File path
    • This can be a directory, a single specific Chutzpah.json file, or a single specific test file.
    • Must be the first option
  • Common /{command}s:
    • /openInBrowser
      • Can occur anywhere (except the first option, which is the path)
      • If no /{command} is given, this is the default.
      • Means we're running the Jasmine stand-alone test suite and serving the results in a browser.
    • /coverage
      • Can occur anywhere (except the first option, which is the path)
      • Currently very limited.
        • A coverage run will be performed in Chrome (corollary: Chrome must be installed)
        • It is written to a coverage dir at the same root as your Chutzpah.json
        • It is opened in your default browser

Example:

If you've installed on macOS with node set up conventionally, this likely will run the included test site's test suite.

khutzpa /usr/local/lib/node_modules/khutzpa/tests/fakeSite/Chutzpah.json /openInBrowser

... or, for Windows (replace [yourUser])...

khutzpa C:\Users\[yourUser]\AppData\Roaming\npm\node_modules\khutzpa\tests\fakeSite\Chutzpah.json /openInBrowser

See the wiki for in-depth explanations about these and other commands, configurations, and options.


In-depth info, including VSCode usage


Background

What's wrong with Chutzpah?

Chutzpah was/is a command-line wrapper for running Jasmine testing and blanket.js test coverage tools for JavaScript projects.

The good thing about Chutzpah is that it's a wrapper around a complex set of tools making it exceptionally easy to set them up even without a thorough knowledge of those tools it uses.

The bad thing about Chutzpah is that it's a wrapper around a complex set of tools, and if the tools it's wrapped go stale, it's insanely difficult to update them. Not to mention all that shielding it did for you initially now means you've potentially got no clue what's up under the hood.

Unfortunately, at this point, Chutzpah's tools are too damn stale. blanket.js hasn't been updated (outside of its license) since 2016 and it doesn't support es6 well. Chutzpah's embedded version of Jasmine isn't much better (though it is a little better. ;^D).

You can learn more about those issues at the Chutzpah project. Here's one that explains that its coverage tool is toast:

Coverage does not work on anything but phantom.js and there are no plans to fix that since the library coverage is built on is deprecated so it would require a total rewrite.

Let's fix that by replacing Chutzpah's out of date pieces with modern tools. Jasmine standalone has been upated. We're using karma and istanbul-lib-coverage for coverage instead of likely defunct blanket.js. We're no longer using PhantomJS to run headless tests (so we can use es6 and up!) and are using Chrome [and only Chrome for now]. You get the point.


Future work

Chutzpah (the original) has excellent Visual Studio integration, including an extension for VS 2019 and 2022.

Currently khutzpa (this pretender to the throne) does not have a Visual Studio "Classic" extension.

Note: I am hopeful we can steal the code to the VS Classic extension (like the context menu stuff from here) and swap out Chutzpah.exe with khutzpa and have an extension working again, but I want this working in VS Code's Chutzpah Runner extension and my builds before we get too far into VS Classic support.


Acknowledgements

As of 24 May 2023...

Each of these may include other dependencies in their package.json requirements. Please review each project for further details.