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

galaxy-parser

v1.0.55

Published

Analyzes your code metric reports and will parse the results into Galaxy

Downloads

774

Readme

Galaxy Parser

Parser tool to read and parse the code metric files that your build already generates and pushes them into Galaxy

NOTE: Galaxy does not do any code analysis or anything, it will just parse files of code coverage, eslint, etc that your project already produces.

Prerequisites

The bare minimum to report into galaxy is to have code coverage reporting in one of the supported formats.

Supported Code Coverage Formats

  • LCOV (JavaScript/? projects)
  • JACOCO XML (Java projects)

Installation

npm install --save-dev galaxy-parser

Getting your project reporting into Galaxy

  1. Create a package.json / Modify the existing package.json

NOTE: The package.json name field is used as the key. Keep it all lower-case with no spaces. I.E my-project or myProject.

  1. Add an entry to the package.json for galaxy
    "galaxy": {
        "display": "My Project", // display name for galaxy (defaults to package.json name)
        "type": "javascript", // type of the project that we are reporting on (javascript|java|php)
        "goal": 80, // goal set for the unit test coverage number (defaults to 80 if not provided),
        "threshold": 0.15 // threshold to not report changes to slack (defaults to 0 if not provided),
        "precision": 2, // precision of decimal places to display for coverage differences (defaults to 2)
        "locations": {
          "sloc": "/coverage/sloc.json", // location of where the sloc.json file is for line of code parsing
          "lcov": "/coverage/lcov.info", // location of where the code coverage is saved
          "jacoco": "/coverage/jacoco.xml", // location of where jacoco saves the xml file
          "jacoco-multi": [ // location of multiple small jacoco files to sum up
            "/coverage/jacoco1.xml",
            "/coverage/jacoco2.xml",
            "/coverage/jacoco3.xml"
          ]
        }
    }

NOTE: Projects will only have one (1) code coverage metric, either lcov or jacoco at this point in time!

  1. Add some scripts to your package.json to manage run the report

This will be different based on the type of project you are working on, this is an example for a JavaScript project:

"loc": "sloc src/ --format json > ./coverage/sloc.json",
"pregalaxy": "npm run loc",
"galaxy": "galaxy analyze"
  1. Add the NPM run scripts into your build process

This will vary on what CI tool that you are using, here are some examples for Jenkins and Travis

Jenkins

// execute shell script (after everything else is done / test coverage ran)
npm run galaxy -- FIREBASE_URL SLACK_WEB_HOOK SLACK_CHANNEL

Travis

after_success:
  - test $TRAVIS_BRANCH = "master" && npm run galaxy $FIREBASE_URL $SLACK_WEB_HOOK $SLACK_CHANNEL
  1. Add private environment variables for FIREBASE_URL, SLACK_WEB_HOOK and SLACK_CHANNEL

Example Integrations

NOTE: On those, the galaxy config is missing the display property. This is defaulted to the package.json name otherwise if not set.