How to use phantomas - 2 common examples

To help you get started, we’ve selected a few phantomas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stefanjudis / grunt-phantomas / tasks / lib / phantomas.js View on Github external
minify(
          this.grunt.file.read( TEMPLATE_FILE ),
          {
            removeComments     : true,
            // TODO fix me
            // https://github.com/stefanjudis/grunt-phantomas/issues/93
            collapseWhitespace : true
          }
        ),
        { data : {
          additionalStylesheet : this.options.additionalStylesheet,
          assertions           : this.options.assertions,
          failedAssertions     : this.failedAssertions,
          group                : this.options.group,
          images               : images,
          meta                 : phantomas.metadata.metrics,
          results              : templateResults,
          timestamp            : this.timestamp,
          url                  : this.options.url,
          version              : this.version
        } }
      )
    );

    this.grunt.log.ok(
      'Phantomas created new \'index.html\' at \'' + this.options.indexPath + '\'.'
    );

    resolve( templateResults );

  }.bind( this ) );
};
github zenorocha / browser-calories-api / index.js View on Github external
export default async function(req, res) {
  const query = url.parse(req.url, true).query;

  if (!query.url) {
    send(res, 403);
  }

  try {
    const data = await phantomas(query.url);
    send(res, 200, formatRes(data.json));
  }
  catch(err) {
    send(res, formatErr(err));
  }
}

phantomas

Headless Chromium-based web performance metrics collector and monitoring tool

BSD-2-Clause
Latest version published 3 months ago

Package Health Score

71 / 100
Full package analysis

Popular phantomas functions