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

@keymux/dev_utils

v0.1.4

Published

A set of developer and devops utilities for projects

Downloads

8

Readme

Keymux Dev Utils

Build Status

Branch | Status ------ | ------ Master | Build Status Dev | Build Status

Dependencies

Ubuntu

  • libssl-dev
  • libcurl4-openssl-dev

Components

directory-changed.js

The directory-changed utility is intended to provide a portable way to diff specific elements of your repository in order to generate a comment for a pull request / merge request.

Usage

#!/bin/bash

# Output a diff if changelog.txt has changed relative to my local master but don't error if not
yarn directory-changed --startsWith=changelog.txt --diffAgainstReference=master --noChangeExitCode=0

Options

Each of these options can be provided optionally, else the default will be used.

name | Required | Default | Explanation --------------------- | --------- | ----------------------------------------- | ----------------- startsWith | no | .changes | Starting path to search for changes, usually a directory noChangeMessage | no | No changes were found | The message to output if there are no modifications found noChangeExitCode | no | -1 | The process exit code to use when no changes were found gitDir | no | .git | The location of the .git directory to use for diffing diffAgainstReference | no | refs/remotes/origin/master | The reference to diff against diffFormatEngine | no | github | The diff format engine

diffFormatEngine

This will be expanded to include more options later, but for now, it only supports bitbucket and github, for which the outputs are the same.

```diff
  existing line
+ added line
- removed line
  existing line
```

Gotchas

Commit your changes before diffing

In order to properly execute the directory-changed script, you need to have already committed your changes. Staged or unstaged changes are not compared.

mochawesome-markdown.js

The mochawesome-markdown utility is intended to provide a portable way to convert mochawesome.json output into markdown format for easy digestion in a pull request comment.

Usage

#!/bin/bash

# Setup shared variables
REPORT_DIR=reports

# Run mochawesome
yarn mocha \
  --reporter mochawesome \
  --reporter-options reportDir="${REPORT_DIR}" \
  test/**

# Convert to markdown
yarn mochawesome-markdown \
  --mochawesome_json="${REPORT_DIR}/mochawesome.json" \
  | tee -a "${REPORT_DIR}/comment"

Options

name | Required | Default | Explanation --------------------- | --------- | ----------------------------------------- | ----------------- mochawesome_json | yes | | The full path to the mochawesome.json file tableHeader | no | Passed,Failed,Skipped,Total,Percent | The header row of the table fields | no | passes,failures,pending,tests,passPercent | The arrangement of output fields pre | no | "","*__","*","","" | Pre-text per data cell, columns delimited by commas post | no | "","__*","*","","%" | Post-text per data cell, columns delimited by commas header | no | | Text to display above the table footer | no | | Text to display below the table

nyc-markdown.js

The nyc-markdown utility is intended to provide a portable way to convert nyc/istanbul output into markdown format for easy digestion in a pull request comment.

Usage

#!/bin/bash

# Setup shared variables
REPORT_DIR=reports

yarn nyc \
  --reporter=lcov \
  --reporter=json-summary \
  --report-dir=${REPORT_DIR}/coverage \
  mocha test/**

yarn nyc-markdown \
  --coverage_filename "${REPORT_DIR}/coverage/coverage-summary.json" \
  | tee -a "${REPORT_DIR}/comment"

Options

name | Required | Default | Explanation --------------------- | --------- | ----------------------------------------- | ----------------- coverage_filename | yes | | The full path to the coverage-summary.json file tableHeader | no | Type,Covered,Skipped,Total,Percent | The header row of the table* pre | no | "","*__","*","","" | Pre-text per data cell, columns delimited by commas post | no | "","__*","*","","%" | Post-text per data cell, columns delimited by commas header | no | | Text to display above the table footer | no | | Text to display below the table

* doesn't affect child rows currently, so it's not particularly useful unless you just want different names.