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

@exercism/javascript-analyzer

v0.16.0

Published

Exercism analyzer for javascript

Downloads

12

Readme

@exercism/javascript-analyzer

javascript-analyzer / main javascript-analyzer / deploy

Runs static analysis using @exercism/static-analysis on exercises from the @exercism/javascript track.

Installation

Clone this repository and then run:

yarn install

You'll need at least Node LTS for this to work.

yarn build

Usage

You can run this either via yarn:

yarn analyze:bat --debug --console two-fer ~/path/to/solution/folder

Or directly via the provided shell script:

./bin/analyze.sh --debug --console two-fer ~/path/to/solution/folder

Add the --debug and --console flags to get output in the terminal window.

Using docker

To create the image, execute the following command from the repository root:

docker build -t exercism/javascript-analyzer .

To run from docker pass in the solutions path as a volume and execute with the necessary parameters:

docker run -v $(PATH_TO_SOLUTION):/solution exercism/javascript-analyzer ${SLUG} /solution

Example:

docker run -v ~/solution-238382y7sds7fsadfasj23j:/solution exercism/javascript-analyzer two-fer /solution

Tools

We use various tools to maintain this repository and this analyzer. In order to contribute to the code of this track, you'll need NodeJS (LTS or higher) installed, with some of the [bin/*][file-bin] files having extra dependencies, as listed in their file-level commentary.

analyze (.sh, .bat)

./bin/analyze.sh two-fer ~/folder/to/solution -dcp

This runs the analyzer using two-fer as exercise and a path to a solution. Most scripts, including this one, accept a wide range of flags to change or enhance the behaviour, as coded in [execution_options.ts][file-execution-options].

Run with the -h / --help flag to get a list of flags and their description.

./bin/analyze.sh --help

You'll most likely want -dcp (--debug,--console and --pretty) during development, which enables console output (instead of stdout/stderr) and shows logger.log as well as logger.error and logger.fatal. It will also format the output JSON with 2 space indentation, both in the output file and the console.

If you wish to preview the actual messages, pass in --noTemplates to use the analyzer CommentFactories to generate actual messages. If the comment factories are kept in-sync with website-copy, it will be the exact same output as on the site.

batch (.sh, .bat)

./bin/batch.sh two-fer -cp

Runs all the fixtures in ~/test/fixtures/two-fer through the analyzer, giving a summary at the end with all results. This places an analysis.json in the source fixture folder.

You'll most likely want -cp (--console and --pretty) during development, which enables console output (instead of stdout/stderr) and formats the output JSON with 2 space indentation.

If you wish to preview the actual messages, pass in --noTemplates to use the analyzer CommentFactories to generate actual messages. If the comment factories are kept in-sync with website-copy, it will be the exact same output as on the site.

remote (.sh, .bat)

./bin/remote.sh https://exercism.io/tracks/javascript/exercises/two-fer/solutions/df3bb5d7131c44ea9c62206cc8d6c225 -dcp --dry

You need the exercism cli in order for this to work. It takes an exercism solution url and downloads it using the exercism cli. It then runs the analyzer on it.

You'll most likely want -dcp --dry (--debug, --pretty, --console and dry run) during development, which enables console output (instead of stdout/stderr), shows logger.log as well as logger.error and logger.fatal, pretty prints the JSON output and disables writing the output to analysis.json.

You can pass the following type of URLs:

  • Published solutions: /tracks/javascript/exercises/<slug>/<id>
  • Mentor solutions: /mentor/solutions/<id>
  • Your solutions: /my/solutions/<id>
  • Private solutions: /solutions/<id>

If you wish to preview the actual messages, pass in --noTemplates to use the analyzer CommentFactories to generate actual messages. If the comment factories are kept in-sync with website-copy, it will be the exact same output as on the site.