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

auditing

v0.0.7

Published

Set the audits once and just run the tests

Downloads

10

Readme

Auditing

Set the audits once and just run the tests. The runner is based on mocha.

Build Status


Installation

cd <project_folder>
npm init # If you don't have a package.json already
npm install --save-dev auditing

Usage

Core usage

I still have to document how you can require and use the core directly but just so that you know, you can do it and the results are based on promises.

CLI

Set a .audit.json and run all the tasks you want when you pass it to auditing.

Note: Any kind of path should be absolute or relative to the place the script is called.

node <mocha_path> <auditing> --mocha=true --config=<config_src>

Notes:

  • <mocha_path>: Pass the path to mocha. For example node_modules/mocha/bin/mocha. You could simply use mocha instead if you have it globally or if you're using npm scripts. It is required
  • <auditing>: Set the path for the auditing main index.js file. It is required
  • <config_json_src>: Path to the config json for crawling. It is required
Example
node ./node_modules/mocha/bin/mocha ./node_modules/auditing/dist/index.js --mocha=true --config=".audit.json"

Configuration

{
    "projectId": "<project_id>",
    "projectName": "<project_name>",
    "data": [{
        "src": ["<url_path>", "<content|markup>", "<file>"],
        "type": "url|content|file",
        "type": {
            "of": "url",
            "base": "<optional_url_base_path>",
            "baseEnv": "<optional_env_var_to_set_base_upon>"
        },
        "enableJs": false,
        "waitFor" : "<html_selector>",
        "audits": ["<path_to_custom>", {
            "src": "<path_to_custom>",
            "ignore": ["<pattern_to_ignore>"]
        }]
    }]
}

Notes:

  • type: It can be an object or a string
  • enableJs: Javascript isn't enable by default for security reasons. Use this if you really need it
  • waitFor: Usually used with enableJs. If the sources uses javascript to render, you may waitFor the selector to be present. It will only wait 20 seconds
  • base: Option only available for type url. Optional key
  • baseEnv: Option only available for type url. Optional key
  • ignore: Ignore rules and nested messages with ignore

Examples

Go under the src/_test/data folder and check the *.json.