Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@foo-software/lighthouse-trigger

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foo-software/lighthouse-trigger

An NPM module to trigger Lighthouse audits to be saved in the cloud.

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Disclaimer

This project is a work in progress - a pre-release version. Please do not attempt to use yet. The projected release date is middle of October, 2019.


CircleCI

@foo-software/lighthouse-trigger

An NPM module to trigger Lighthouse audits to be saved in the cloud. Triggers audits for URLs associated with a lighthouse-check.com account. Utilizing this module within a release or integration workflow would be a standard use case.

Install

npm install @foo-software/lighthouse-trigger

or

yarn add @foo-software/lighthouse-trigger

Usage

Calling lighthouseTrigger in the example below will trigger Lighthouse audits for all URLs associated with the account having an API token of abc123.

const { lighthouseTrigger } = require('@foo-software/lighthouse-trigger');

const init = async () => {
  const response = await lighthouseTrigger({
    apiToken: 'abc123'
  });

  console.log('response', response);
};

init();

To run Lighthouse audits on a subset of URLs, you can specify an array of URLs denoted by their respective API tokens. Example below.

lighthouseTrigger({
  apiToken: 'abc123',
  urls: ['cde456', 'fgh789']
});

Parameters

lighthouseTrigger accepts a single configuration object with the below properties we can think of as parameters.

NameDescriptionTypeRequired
apiTokenThe lighthouse-check account API token found in the dashboard.stringyes
urlsAn optional list of URLs represented by their respective API token. URL API tokens can be found in the dashboard.arrayno
tagAn optional tag or name (example: build #2 or v0.0.2).stringno

Return Payload

It's important to note that lighthouseTrigger() function is encapsulated by a try / catch, so an object should always be returned. Errors are caught, but populated in the return object below.

NameDescriptionType
codeA code to signify failure or succes.oneOf(["SUCCESS", "ERROR_GENERIC", ...]) see errorCodes.js for all error codes.
dataAn array of results returned by the API.array
errorIf there was a problem, this property will typically be populated with an error object. This field is only populated when an error was caught or the params didn't pass validation.object (typically an error object)
messageA message to elaborate on the code. This field isn't always populated.string

Credits

This package was brought to you by Foo - a website performance monitoring tool. Create a free account with standard performance testing. Automatic website performance testing, uptime checks, charts showing performance metrics by day, month, and year. Foo also provides real time notifications when performance and uptime notifications when changes are detected. Users can integrate email, Slack and PagerDuty notifications.

Keywords

FAQs

Package last updated on 18 Sep 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc