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.1.0 to 0.2.0

2

lib/browser.js

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

browserName: 'chrome',
pageLoadStrategy: 'none',
loggingPrefs: {

@@ -14,3 +15,2 @@ performance: 'ALL'

perfLoggingPrefs: {
enableNetwork: true,
traceCategories: 'devtools.timeline'

@@ -17,0 +17,0 @@ }

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

opts.count = opts.count || 5;
opts.sleep = opts.sleep || 0;
if (!opts.url) {

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

@@ -14,3 +14,3 @@ /**

line.message = JSON.parse(line.message);
line.timestamp = line.message.message.params.timestamp || line.message.message.params.ts / 1e6;
line.timestamp = line.message.message.params.timestamp || (line.message.message.params.ts / 1e6);
} catch (e) {}

@@ -20,5 +20,15 @@ return line;

lines = lines.filter((l) => !isNaN(l.timestamp));
lines = lines.sort((a, b) => a.timestamp < b.timestamp ? -1 : 1);
return lines.slice(getStart(lines, host));
lines = lines.slice(getStart(lines, host));
const start = lines[0].timestamp;
lines.forEach(l => {
l.timestamp -= start;
});
return lines;
}

@@ -25,0 +35,0 @@

@@ -0,1 +1,2 @@

const wd = require('wd');
const Promise = require('bluebird');

@@ -10,2 +11,17 @@ const browser = require('./browser');

.get(opts.url)
.then(() => {
return Promise.resolve()
.then(() => {
if (typeof opts.inject === 'function') {
return opts.inject(session);
}
})
.then(() => {
return session.waitFor(wd.asserters.jsCondition(`document.readyState==='complete'`), 30000);
})
.then(() => {
return session;
});
})
.sleep(opts.sleep)
.log('performance')

@@ -12,0 +28,0 @@ .then((logs) => {

@@ -8,3 +8,2 @@ const wd = require('wd');

opts.browser = wd.remote('http://localhost:9515', 'promiseChain');
return Promise.map(times(opts.count), page(opts), { concurrency: 1 });

@@ -11,0 +10,0 @@ }

{
"name": "timeliner",
"version": "0.1.0",
"version": "0.2.0",
"description": "Network Timeline Analyser",

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

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