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

calibre

v6.0.0

Published

Calibre - Page speed performance testing with Google Lighthouse

Downloads

263,396

Readme

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

NPM package Node version support License

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. Contributing
  8. Resources
  9. License

📥 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 or Calibre’s documentation.

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))

🙌🏻 Contributing

Happy to hear you’re interested in contributing to Calibre’s APIs! Please find our contribution guidelines here.

🖥 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.

💼 License

This project is MIT licensed.