New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

timeliner

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timeliner - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

lib/reporters/fps.js

1

lib/index.js

@@ -10,2 +10,3 @@ const Promise = require('bluebird');

opts.sleep = opts.sleep || 0;
opts.scroll = opts.scroll || false;
if (!opts.url) {

@@ -12,0 +13,0 @@ return Promise.reject(new Error('`url` option must be provided'));

@@ -14,2 +14,7 @@ const wd = require('wd');

.then(() => {
if (opts.scroll) {
return session.execute('function f () { window.scrollBy(0,5); window.requestAnimationFrame(f); } window.requestAnimationFrame(f);');
}
})
.then(() => {
if (typeof opts.inject === 'function') {

@@ -16,0 +21,0 @@ return opts.inject(session);

7

lib/reporters/basic.js

@@ -5,7 +5,6 @@ const mean = require('lodash.meanby');

const timings = data.map((set) => {
const start = set[0].message.message.params.timestamp;
return {
domcontentloaded: getEventTime('Page.domContentEventFired', set) - start,
load: getEventTime('Page.loadEventFired', set) - start,
render: getProfileTime('Paint', set) - start
domcontentloaded: getEventTime('Page.domContentEventFired', set),
load: getEventTime('Page.loadEventFired', set),
render: getProfileTime('Paint', set)
};

@@ -12,0 +11,0 @@ });

module.exports = {
basic: require('./basic'),
fps: require('./fps'),
json: (data) => JSON.stringify(data, null, ' ')
};
{
"name": "timeliner",
"version": "0.4.0",
"version": "0.5.0",
"description": "Network Timeline Analyser",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -39,6 +39,14 @@ # timeliner

*Optional* - set the nuber of times to load the page before aggregating results - Default `5`
set the number of times to load the page before aggregating results - Default `5`
### `reporter`
*CLI only* - *Optional* - set the reporter to be used to output results - supported values: `basic`, `json`
*CLI only* - set the reporter to be used to output results - supported values: `basic`, `fps`, `json`
### `scroll`
if set, injects a script into the page which binds a vertical scroll to `window.requestAnimationFrame` making the page scroll continuously - Default `false`
### `sleep`
set how long (in ms) after the page completes loading to continue recording metrics - Default `0`

Sorry, the diff of this file is not supported yet

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