Menu Developer Moovweb University

moov_perf

Introduction

moov_perf is a MoovJS Node module that provides a number of methods to enhance performance on your Moovweb-transformed project site.

Documentation

Perf should always be required first.

const Perf = require("moov_perf");

Perf extends an existing selector engine prototype. When instantiating the perf object, pass in the prototype of your selector engine (with Moovweb, this is the global $). This gives you access to the Perf functions while modifying a selection, as well as a blacklist for domains you specifically do not wish to optimize while performing image optimizations.

let perf = new Perf($);

Development

Quick Start

$ cp .npmrc.example .npmrc
$ npm install

This will build the Node modules that moov_perf depends under the local moov_perf directory. The npm-shrinkwrap.json file is used to version-lock all dependencies.

Tests

$ npm test

Run Locally via Node CLI

$ node --harmony
...
> var perf = require("./main.js");
> var selector = require("moov_cheerio").cheerio;
> var my_perf = new perf(selector);
Last updated Tue Nov 15 2016 22:28:30 GMT+0000 (UTC)