{"name":"speedline-core","version":"1.4.2","description":"Get the speed index from chrome dev tool timeline files","license":"MIT","repository":{"type":"git","url":"git+https://github.com/paulirish/speedline.git"},"main":"lib","engines":{"node":">=5.0"},"scripts":{"lint":"xo","unit":"ava","test":"yarn run lint && yarn run unit"},"types":"speedline.d.ts","keywords":["chrome","devtools","timeline","speed","index","performance"],"dependencies":{"@types/node":"*","image-ssim":"^0.2.0","jpeg-js":"^0.1.2"},"devDependencies":{"ava":"^0.19.1","xo":"^0.14.0"},"bugs":{"url":"https://github.com/paulirish/speedline/issues"},"homepage":"https://github.com/paulirish/speedline#readme","_id":"speedline-core@1.4.2","_npmVersion":"6.1.0","_nodeVersion":"8.11.1","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"integrity":"sha512-9/5CApkKKl6bS6jJ2D0DQllwz/1xq3cyJCR6DLgAQnkj5djCuq8NbflEdD2TI01p8qzS9qaKjzxM9cHT11ezmg==","shasum":"bb061444a218d67b4cd52f63a262386197b90c8a","tarball":"http://registry-npm.ywwl.com/speedline-core/download/speedline-core-1.4.2.tgz","fileCount":7,"unpackedSize":142556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbow3UCRA9TVsSAnZWagAAUJsP/AljsBV2mY0hoonWS+JB\nOYhpbERp5HaCu/u81KkoBcl0eXd6yBBswb6MrEIYRGHMnlj44rpeZ/nZSyAP\nrHiwCvfgAjguSHyi9CYnHUE9Xxw3rNQhq5ohKJCRsQHNJoMJB0CtrIKmywep\nJCYngeRwng9+xtMzprhEmjjRmMmkQByz1JL2eHSifdrgREBXRb3aXBmn0YEV\nXD+T6/q/UNqj+paO7lNUKMz4alccnK+Db8iX2s7DnJNQgxGEGy+GjvjvW7g8\nXvh1/gL0d3+cyiZJralcAh09H6424lBD8WMgG2E635Cewo73li34RKxasGy0\n8Q1qtGsdagbH8FbaGwKknElT3LRRY8+gOAV7FppVRicPO5S3IvsAQbgUPE8X\nyIIADCkYNlLeXOrhjqb1gQqWELl4je4R0gdNUe1nWdthrgZaa2mAD5LiEMit\n6NBS3D9EBdEgcLDShbnwSa0+ZxleMsnOwYVxns8vGjyZB214kJ2KIQ3LSbZ1\nmTc1x8EjdPlfN+7OweyIxplhiIp8XHPcqEeBpr4+4kuHttGXL9AKvieCxuzc\nVi+q4e1kI9ywgiuRA4lmqBNelfhXIyTPflrsmKhuuECJpXO7vzGNFZkTBFbs\n1Gbuz2JGsx+wALIrbT/vRBW3ESrGrAf2FombI1Z77Q9m4jOP7wVgHme+QREu\npiXX\r\n=nFi1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGR0Tm8Lfk1pmz2TVnn664cpVlC0Qu28sjruYlD4VY08AiEA2YF5Kans49nEWBIM/Olf+hKL5p5Zp9lYDjlbsVgsXnU="}],"size":39352,"noattachment":false,"key":"/speedline-core/-/speedline-core-1.4.2.tgz"},"maintainers":[{"name":"paulirish","email":"paul.irish@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/speedline-core_1.4.2_1537412563706_0.7714217737410105"},"_hasShrinkwrap":false,"readme":"# speedline-core\n\nThis is the core module for speedline, without any CLI dependencies. See [speedline](https://github.com/paulirish/speedline) for the CLI.\n\n### Install\n\n```bash\n$ npm install speedline\n```\n\n### Usage\n\n```js\nconst speedline = require('speedline-core');\n\nspeedline('./timeline').then(results => {\n  console.log('Speed Index value:', results.speedIndex);\n});\n```\n\n### API\n\n#### `speedline(timeline [, opts])`\n\n* (string | object[]) `timeline`\n* (object) `opts`\n\nReturns a (Promise) resolving with an object containing:\n  * `beginning` (number) - Recording start timestamp\n  * `end` (number) - Recording end timestamp\n  * `speedIndex` (number) - speed index value.\n  * `perceptualSpeedIndex` (number) - perceptual speed index value.\n  * `first` (number) - duration before the first visual change in ms.\n  * `complete` (number) - duration before the last visual change in ms.\n  * `duration` (number) - timeline recording duration in ms.\n  * `frames` ([Frame](#frame)[]) - array of all the frames extracted from the timeline.\n\n**`timeline` parameter**:\n* `string` - the parameter represents the location of the of file containing the timeline.\n* `array` - the parameter represents the traceEvents content of the timeline file.\n\n**`opts` parameter**:\n* `timeOrigin`: Provides the baseline timeStamp, typically navigationStart. Must be a monotonic clock timestamp that matches the trace.  E.g. `speedline('trace.json', {timeOrigin: 103205446186})`\n* `fastMode`: If the elapsed time and difference in similarity between two screenshots are small, fastMode will skip decoding and evaluating the frames between them.\n* `include`: Specifies which speed indexes to compute, can be one of `all|speedIndex|perceptualSpeedIndex`, defaults to `all`.\n\n#### `Frame`\n\nObject representing a single screenshot.\n\n* `frame.getHistogram()`: (number[][]) - returns the frame histogram. Note that light pixels informations are removed from the histogram, for better speed index calculation accuracy.\n* `frame.getTimeStamp()`: (number) - return the frame timestamp.\n* `frame.getImage()`: (Buffer) - return the frame content.\n* `frame.getProgress()`: (number) - return the frame visual progress.\n* `frame.getPerceptualProgress()`: (number) - return the frame perceptual visual progress.\n\n\n## License\n\nMIT © [Pierre-Marie Dartus](https://github.com/pmdartus)\n","publish_time":1537412563962,"_cnpm_publish_time":1537412563962,"dist-tags":{"latest":"1.4.3"}}