@modus/gimbal
A CLI tool for monitoring web performance in modern web projects
Last updated 7 months ago by mitchellsimoens-user .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @modus/gimbal 
SYNC missed versions from official npm registry.
      ___                       ___                         ___
     /\__\                     /\  \         _____         /\  \
    /:/ _/_       ___         |::\  \       /::\  \       /::\  \
   /:/ /\  \     /\__\        |:|:\  \     /:/\:\  \     /:/\:\  \
  /:/ /::\  \   /:/__/      __|:|\:\  \   /:/ /::\__\   /:/ /::\  \   ___     ___
 /:/__\/\:\__\ /::\  \     /::::|_\:\__\ /:/_/:/\:|__| /:/_/:/\:\__\ /\  \   /\__\
 \:\  \ /:/  / \/\:\  \__  \:\~~\  \/__/ \:\/:/ /:/  / \:\/:/  \/__/ \:\  \ /:/  /
  \:\  /:/  /     \:\/\__\  \:\  \        \::/_/:/  /   \::/__/       \:\  /:/  /
   \:\/:/  /       \::/  /   \:\  \        \:\/:/  /     \:\  \        \:\/:/  /
    \::/  /        /:/  /     \:\__\        \::/  /       \:\__\        \::/  /
     \/__/         \/__/       \/__/         \/__/         \/__/         \/__/

  _                 __  __               _                    ____                         _
 | |__    _   _    |  \/  |   ___     __| |  _   _   ___     / ___|  _ __    ___    __ _  | |_    ___
 | '_ \  | | | |   | |\/| |  / _ \   / _` | | | | | / __|   | |     | '__|  / _ \  / _` | | __|  / _ \
 | |_) | | |_| |   | |  | | | (_) | | (_| | | |_| | \__ \   | |___  | |    |  __/ | (_| | | |_  |  __/
 |_.__/   \__, |   |_|  |_|  \___/   \__,_|  \__,_| |___/    \____| |_|     \___|  \__,_|  \__|  \___|
          |___/

npm (scoped) npm CircleCI PRs Welcome MIT Licensed Powered by Modus_Create

Gimbal - Web Performance Budgeting Automation

Installation | Documentation | Contributing | Code of Conduct | Twitter

Gimbal uses industry-standard audits to analyze application performance. Continuously track performance to ensure your apps are within acceptable performance budgets.

Gimbal ❤️ CIs like Circle CI and Travis CI.

Audits

  • Lighthouse
  • File sizes
  • Directory sizes
  • Heap memory
  • CSS and JS coverage

Getting Started

You can install Gimbal globally using npm or yarn:

# with npm
npm install --global @modus/gimbal

# or with yarn
yarn add global @modus/gimbal

gimbal --help

Now the gimbal is executable throughout your system for any projects you want to audit.

You can also install it to a specific project as a development dependency.

# with npm
npm install --save-dev @modus/gimbal

# or with yarn
yarn add --dev @modus/gimbal

You can execute it via a npm script: (package.json):

{
  "scripts": {
    "audit": "gimbal audit"
  }
}
# with npm
npm run audit

# or with yarn
yarn audit

Usage Examples

  • ⚛️ Create React App: gimbal audit
  • ???? Gatsby: gimbal audit --build-dir ./public

Prerequisites

  • You should be using Create React App
  • Make sure you've built the app (npm run build or yarn build)
  • build/ directory is assumed

Sample Output

Expand audits below for more detail.

<summary>Size Checks (2 failures)</summary>

Label Value Threshold Success
.../build/precache-manifest.380adf610922866d450d1a7155a60b54.js 646 B 5 B x
.../build/static/js/2.b41502e9.chunk.js 115.99 KB 50 KB x
.../build/static/js/main.28647029.chunk.js 1.09 KB 50 KB
.../build/static/js/runtime~main.a8a9905a.js 1.47 KB 30 KB
.../build 479.43 KB 500 KB

<summary>Lighthouse Audits (0 failures)</summary>

Label Value Threshold Success
Performance 99 95
Accessibility 79 75
Best Practices 100 95
SEO 90 90
Progressive Web App 58 50

<summary>Unused Source Checks (3 failures)</summary>

Label Value Threshold Success
http://localhost:3000 41.77% 30% x
...static/css/main.584f321a.chunk.css 34.36% 30% x
http://localhost:3000/ 25.40% 30%
...static/js/2.b41502e9.chunk.js 42.40% 30% x
...static/js/main.28647029.chunk.js 2.59% 30%

<summary>Heap Snapshot Checks (0 failures)</summary>

Label Value Threshold Success
Documents 5
Frames 2
JSHeapTotalSize 4472832
JSHeapUsedSize 3399040
LayoutCount 3 5
Nodes 55
RecalcStyleCount 3

Programmatic Usage

You can use Gimbal from other node scripts as an external module. Note that configuration file will be automatically parsed.

const { audit } = require('@modus/gimbal');

async function customAudits() {
  const response = await audit({
    cwd: process.cwd(),
    buildDir: './public',
    comment: true,
    verbose: false,
    checkThresholds: true,
  });

  return response;
}

Configuration

Gimbal supports configuration files in JavaScript, JSON and YAML formats. This configuration file will let Gimbal know what to execute, you can modify configurations for modules, and output reports in different formats (HTML, JSON, and Markdown). Just place a .gimbalrc.yml (or .gimbalrc.js or .gimbalrc.json) in the root of your project where you will execute Gimbal. An example configuration file would look like:

configs:
  puppeteer:
    headless: false

outputs:
  html: ./artifacts/gimbal.html
  json: ./artifacts/gimbal.json
  markdown: ./artifacts/gimbal.md

More about configurations can be found on the individual documentation pages of each commands and modules.

We recommend going through the entire ????documentation section.

Thresholds

The main purpose of Gimbal is to run audits against an application. Each audit has it's own threshold or set of thresholds. Gimbal also comes configured by default to allow a create-react-app to pass. If you were to start with a React application created from CRA, you will need to adjust the thresholds as your application will inevitably grow in size. Each module can have it's thresholds configured via the configuration file. For example, the size module's thresholds are configured via an array of objects:

configs:
  lighthouse:
    outputHtml: artifacts/lighthouse.html
    threshold:
      accessibility: 93
      'best-practices': 90
      performance: 50
      pwa: 75
      seo: 100
  heap-snapshot:
    threshold:
      Documents: 5
      Frames: 2
      JSHeapTotalSize: 23356000
      JSHeapUsedSize: 15068000
      Nodes: 800
      RecalcStyleCount: 9
  size:
    - path: ./build/precache-*.js
      maxSize: 500 B
    - path: ./build/static/js/*.chunk.js
      maxSize: 1 MB
    - path: ./build/static/js/runtime*.js
      maxSize: 10 KB
    - path: ./build/vendor.*.js
      maxSize: 250 KB
    - path: ./build/!(vendor).*.js
      maxSize: 200 KB
    - path: ./build/
      maxSize: 18 MB
  unused-source:
    threshold: 0%
  outputs:
    html: artifacts/results.html
    json: artifacts/results.json
    markdown: artifacts/results.md
  jobs:
    - audit

More about configuring thresholds can be found on the individual documentation pages of each commands and modules.

Available Plugins

There are some plugins that are available that increase Gimbal's functionality:

Continous Integration

Feel free to use our sample configuration files for major CI systems.

System Requirements

Gimbal runs on any OS with Node.js (10.0.0+).

Gimbal is built to support Cloud and CI environments. It can audit 1000 pages in under 10 seconds on AWS Lambda.

Questions and Support

If you have a problem running Gimbal, please submit an issue. The more information you give us the faster we can get back with a good answer.

Modus Create

Modus Create is a digital product consultancy. We use a distributed team of the best talent in the world to offer a full suite of digital product design-build services; ranging from consumer facing apps, to digital migration, to agile development training, and business transformation.

Modus Create

This project is part of Modus Labs.

Modus Labs

Licensing

This project is MIT licensed.

Current Tags

  • 1.2.6                                ...           latest (7 months ago)

38 Versions

  • 1.2.6                                ...           7 months ago
  • 1.2.5                                ...           8 months ago
  • 1.2.4                                ...           8 months ago
  • 1.2.3                                ...           9 months ago
  • 1.2.2                                ...           9 months ago
  • 1.2.1                                ...           9 months ago
  • 1.2.0                                ...           9 months ago
  • 1.1.14                                ...           10 months ago
  • 1.1.13                                ...           10 months ago
  • 1.1.12                                ...           10 months ago
  • 1.1.11                                ...           10 months ago
  • 1.1.10                                ...           10 months ago
  • 1.1.9                                ...           10 months ago
  • 1.1.8                                ...           10 months ago
  • 1.1.7                                ...           10 months ago
  • 1.1.6                                ...           10 months ago
  • 1.1.5                                ...           10 months ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 1.0.0-1                                ...           a year ago
  • 1.0.0-0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (23)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |