{"name":"speedline-core","version":"1.4.0","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.0","_npmVersion":"6.3.0","_nodeVersion":"10.4.1","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"integrity":"sha512-GEUB8IZCV8fXF2ZIekwg0HkI/3HnALfysw3nPsVMBPoZHwD8eT53pIzCZ6qBR7gU3VFadjmKAWT9w0Cvqp2MXQ==","shasum":"884831eaef66ddc928dd7d4c9e844c5d28bad7db","tarball":"http://registry-npm.ywwl.com/speedline-core/download/speedline-core-1.4.0.tgz","fileCount":8,"unpackedSize":7654068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbafVjCRA9TVsSAnZWagAADcAQAJ7Y/dcPlpeq5A6p4Wyc\nOYX8H+vsv2Qif99aKLlHuw4Ugd6c15tWcnaQL/b5hvlP4hVx/8fYepcCOgZ7\nzKeBTqPDO0uzcd8zuv53D/UtbXr5zLSpH5LR7J+/GaX2gSbGpyIBEu2n1vmq\nJZCrKHs5KOzg6AEIzT74mli/O4X4vyXzz7q4H2MSF8xmrPVhFIKjpAQxfOq2\nZExlBoDvcCAXvto8q1oEirVu7iLMDMnk1fAK3l9i9tKSlaUJKRhAw0p+NF1j\naY5ea727V5G+oyz4PBKy4/4a/lcwr0H43HuqtLZKURbq7G4xswM58kL6FTpj\nCZcjJXWQdClNmGVTs9mzskj9Wc+IYfY0LvmD1Uhzyjw9XePAZZ9hPJj1EI/K\nlglvZ6CUW6wW4xbFJuk893AZYkq1GnFivYV2x4p1LxUImeCdd0LcQNe0Rn3o\nx+9m+4+jhXvfuk1IfnmaQ0dt24b7UWsaaVqKbP0zNfdCH5MDC3b+90CBd/5h\nSkAqYU6HA9TjZkgsXbKjMRz2HxZsh9eoedW7LQvvh/rvy0oOP+Qb9YRh1i1s\nY/YZOoYElscj/N1tMXgDbSEBEvuAVNBuLmfnl5BrtNqTIwLkeevnAciXFY//\nz090lyhh6Wa23hK3K5uizM9K5eoKqgXCPvSeFQdaKlY3YrDVS1SaGUmbViZl\n70Hz\r\n=TqXo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC23LEdZjxmfulWXoFJBZPXIjavpBHVfFGrr/O4qB5FJAiBHBfWHc7hkTqr0SV5B7IRtp2etpukR9KqduIWlp3Sx1w=="}],"size":7557360,"noattachment":false,"key":"/speedline-core/-/speedline-core-1.4.0.tgz"},"maintainers":[{"name":"paulirish","email":"paul.irish@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/speedline-core_1.4.0_1533670755316_0.12319963676755119"},"_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":1533670755985,"_cnpm_publish_time":1533670755985,"dist-tags":{"latest":"1.4.3"}}