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

@acot/cli

v0.0.19

Published

More accessible web, all over the world.

Downloads

2,303

Readme

@acot/cli

acot's built-in Command Line Interface.

Its main function is to execute an audit. It also provides other features to help you create configuration files and develop presets.

Installation

Install via npm:

$ npm install --save-dev @acot/cli

# or

$ npm install --save-dev @acot/cli puppeteer

Note:

acot can be installed globally, but we recommend doing a local install.

Usage

Please install @acot/cli first before npx acot. Other than npx, you can also drop it inside of an npm run script or you may instead execute with the relative path instead. ./node_modules/.bin/acot.

$ npx acot <command> [flags]

Run npx acot --help or npx acot help for full help.

Global Flags

-q, --quiet

Disable stdout/stderr.

Example:

$ npx acot run --quiet

-v, --verbose

Enable logging. Indicators such as Progress and Spinner are disabled.

Example:

$ npx acot run --verbose

--debug

Dump debug information for acot modules. Can filter output by specifying the module name.

Example:

# all modules
$ npx acot run --debug

# core module
$ npx acot run --debug "core"

# cli module
$ npx acot run --debug "cli"

# acot-preset-wcag rules
$ npx acot run --debug "wcag/*"

--no-color

Force disabling of color. acot uses the chalk package. See the chalk documentation for more details.

Example:

$ npx acot run --no-color

--help

Show help.

Example:

$ npx acot --help
$ npx acot run --help

--version

Output the version number.

Example:

$ npx acot --version

Commands

The acot CLI has several subcommands. The following is an overview of them and how to use them.

init

Building a config file and installing dependent packages. See the Configuration for details.

acot init [flags]

Flags:

-o, --origin                  Audit server base URL.
-C, --command                 Command to launch the local server.
    --use-recommended-config  Use the config recommended by acot.
-r, --runner                  Runner to use for audit.
-s, --format                  Format to use for the configuration file.
    --install-puppeteer       Install Puppeteer as a dependency.
    --no-install-puppeteer    Not install Puppeteer as a dependency.
    --npm-client              npm client to use for dependent packages installations. (npm or yarn)

Example:

# Answer all questions interactively
$ npx acot init

# Answer some questions with flag
$ npx acot --format javascript --use-recommended-config

run

Running an audit. acot automatically reads and uses the configuration file. If you want to change the file to use, use --config flag.

acot run <paths..> [flags]

Flags:

-o, --origin                  Target server URL origin.
-C, --command                 Command to launch the local server.
    --reporter                Name of the reporter. (default: "@acot/pretty")
    --reporter-with           Reporter options. Specify the JSON as a string.
-p, --parallel                Number of parallel audit browsers. (default: "os.cpus().length - 1")
-c, --config                  Provide path to a acot configuration file (e.g. "./acot.config.js")
-V, --viewport                Viewport used for browser access. One of JSON string or "<number>x<number>".
    --working-dir             Directory path used by acot store temporary files. (default: ".acot")
    --max-warnings            Warning threshold to be treated as an error.
    --connection-timeout      Timeout ms for connecting to the host server.
    --browser-timeout         Timeout ms to wait for pooled browsers.
    --ready-timeout           Timeout ms waiting for page load.
    --chrome-channel          Channel to search local Chromium. One of "puppeteer", "canary", "stable", "*". (default: "*")
    --chrome-executable-path  Executable Chromium path.
    --launch-options          JSON string of launch config for Puppeteer.

Example:

$ npx acot run
$ npx acot run --origin "https://example.com"
$ npx acot run --reporter "dot"
$ npx acot run --config "./acot.config.storybook.js"
$ npx acot run --command "npm start"

preset test

Test the rules provided by the preset according to the documentation.

acot preset test [flags]

Flags:

-p, --project   Directory path that contains the package.json that makes up the preset.
-d, --docs      Directory path that contains the rule documentation.
    --port      Port number for preview server.
    --parallel  Number of parallel audit browsers. (default: "os.cpus().length - 1")

Example:

$ npx acot preset test
$ npx acot preset test --port 3000
$ npx acot preset test --project "./packages/acot-preset"
$ npx acot preset test --docs "./docs"

preset serve

Launch a server that delivers the documentation created for the rules provided by the preset as HTML.

acot preset serve [flags]

Flags:

-p, --project   Directory path that contains the package.json that makes up the preset.
-d, --docs      Directory path that contains the rule documentation.
    --port      Port number for preview server.
-w, --watch     Watch document files.
    --no-open   Does not open the browser automatically.

Example:

$ npx acot preset serve
$ npx acot preset serve --port 3000
$ npx acot preset serve --watch

preset docgen

Document generation of the list of rules provided by the preset.

acot preset docgen <target> [flags]

Flags:

-p, --project   Directory path that contains the package.json that makes up the preset.
-d, --docs      Directory path that contains the rule documentation.
    --dry-run   Writes the document to standard output instead of a file.

Example:

$ npx acot preset docgen
$ npx acot preset docgen --dry-run

help

Show help.

acot help <command..>

Example:

$ npx acot help
$ npx acot help run
$ npx acot help preset serve

version

Show version.

acot version

Example:

$ npx acot version