Home

Awesome

oc-warmup Build Status

Greenkeeper badge

NPM

Allows to warmup all components for a given OpenComponents' registry. In practice, given every registry's instance has an internal cache for components' compiled views and server.js' closures, the module performs the following actions:

var warmup = require('oc-warmup');

warmup({
  url: 'http://registry-01234.mycompany.com/',

  // optional params
  components: c => c.name === 'header' && c.oc.state !== 'deprecated',
  headers: { 'accept-language': 'en-US' },
  timeout: 20000
}, (error, result) => {
  console.log(error);
  // => something like 'error connecting to registry' or null

  console.log(result);
  // => something like { successful: ['a', 'b'], errors: ['* c: error blabla (500)']}
});

License

MIT