Socket
Socket
Sign inDemoInstall

calibre

Package Overview
Dependencies
163
Maintainers
4
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    calibre

Calibre - Page speed performance testing with Google Lighthouse


Version published
Weekly downloads
31K
increased by15.35%
Maintainers
4
Install size
22.6 MB
Created
Weekly downloads
 

Changelog

Source

5.0.0 (2022-04-29)

💥 Breaking changes

  • Ends support for Node 12 (end of life as of 2022-04-30).
  • Discontinues packaged binary builds: releases only via npm.

🚩 Commands and flags

  • Adds a new flag for calibre test create: --waitForTest (default: false).

🛠 Core

  • Adds a new package export: cli-commands (returns all command functions and CLI options).
  • Adds a new package export: cli-metadata (returns all command documentation).
  • Adds a new package script: npm run generate-cli-md (generates CLI_COMMANDS.md CLI documentation file).
  • Now written in ES Modules.
  • Adds build step for producing CommonJS entry points.
  • Adds built-in throttling to requests made with the API so they don't hit the request limit.

🧹 Housekeeping

  • Turns ESLint on for the build process.

📖 Documentation

  • Updates README.md to reflect current usage.
  • Updates all Node.js examples to ES Modules.
  • Adds CLI_COMMANDS.md that showcases all available commands and subcommands with their options.

Readme

Source

Calibre CLI - Automate your performance system

NPM package

Calibre’s Node.js API and Command Line Client (CLI)

This repository contains Calibre’s APIs you can use to fetch and manage your monitoring data. The Command Line Client (CLI) is designed for simple tasks right from your terminal. We recommend using the Node.js API for more complex tasks and automation.

ℹ️ Please note: Using the APIs requires an active Calibre account (in trial or on a paid plan).

🖇 Table of Contents

  1. Installation
  2. Authentication
  3. Features
  4. Usage
  5. Package Exports
  6. Script Examples
  7. Resources

📥 Installation

To install the latest version globally, run this command:

npm install -g calibre

or save it directly to your project:

npm install calibre --save

The calibre package is built to support all current Node.js LTS releases.

🔐 Authentication

To authenticate to Calibre and use the APIs, you will need to create or use an existing API Token. Learn about the types of API Tokens and how to create them here.

Once you have an API Token, you can store it locally:

calibre token set <your token>

Or alternately, set CALIBRE_API_TOKEN environment variable.

💡 Features

  • Manage performance with a single command. Retrieve all speed data and manage the test environment and settings.
  • Run Single Page Tests. Create one-off tests privately or share them with your team.
  • Monitor speed across your release process. Track performance between deploys and mark them on your charts.
  • Use Calibre within CI/CD. Every command has a --json flag for machine-readable output.
  • Script any action. We export all API methods to the Calibre npm package..

🛠 Usage

To see a full list of available commands, subcommands and options run:

$ calibre --help
$ calibre <command> --help

or see all commands in this repository.

In Node, you can use the either ES Modules or CommonJS versions accordingly:

// ES Modules
import { Site } from 'calibre'
await Site.list()
// CommonJS
const { Site } = require('calibre')
await Site.list()

📤 Package exports

In addition to the named default exports shown above, the calibre package also exports CLI related metadata, which is used to generate CLI documentation.

CLI Commands

Each CLI command is a Node module that exports command, describe, handler and builder. You can import all CLI commands from calibre/cli-commands (see src/cli.js for reference).

import Commands from 'calibre/cli-commands'

CLI Metadata

You can import command metadata (used to generate CLI documentation) from the calibre/cli-metadata export:

import { getCommandMetaData } from 'calibre/cli-metadata'
console.log(JSON.stringify(getCommandMetaData(), null, 2))

🖥 Script Examples

We prepared a handful of examples for common actions you might want to perform:

📚 Resources

Find code examples and more information for the CLI and Node.js API in our documentation.

Keywords

FAQs

Last updated on 28 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc