{"name":"speedline-core","version":"1.4.3","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":">=8.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.4.1"},"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.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"patrickhulce","email":"patrick.hulce@gmail.com"},"dist":{"integrity":"sha512-DI7/OuAUD+GMpR6dmu8lliO2Wg5zfeh+/xsdyJZCzd8o5JgFUjCeLsBDuZjIQJdwXS3J0L/uZYrELKYqx+PXog==","shasum":"4d6e7276e2063c2d36a375cb25a523ac73475319","tarball":"http://registry-npm.ywwl.com/speedline-core/download/speedline-core-1.4.3.tgz","fileCount":7,"unpackedSize":142665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIFRQCRA9TVsSAnZWagAAkgkP/R8I23VASYlY6P0Afa6z\nGa/c9lLijrNQ4YuQrkJifqZGcE1PAd8PnnLwAud+rLvxEq6s2rHOypVeG1ld\nSbRmHaU/rgz8GHcDAv5kEVMzJLWcUJr0EzStRnZhhGhi9YACnWZ5BhEa+6Lf\nInUxetXmDveFJ3PtUpwPiutCUhT/VXXq39WFQsoQ+7Cs+EOPvqe4ZIgG6WyC\nQYmP1JV8v5VFTeLLuyRDEWwHzzWa7RlsNpO6ghTHb/t6VdXHmEGrGufUv0to\nNuWG5YCmGy37k8XsYnd2/cPKxnWEK9ZGDBRQ8osT9x/h1/OfuukUwftDR3f4\nEa+XArbD5GWzITt8j22OS94AIdHRsKb8J1vp5LrtdwDKpyXpR+auI0C0wQvK\nLU0ShuVuVBO+m2CxhoZ7dfw3Va20J86zZpLGhezb+1N/eXWLIp6LcNkMfotK\nRKgHJiwfcl0WuPowpig334OGbYMaOWkD/D9NFGa8bF0ks01IbKk+YOpkqBpE\nexMY0TLG5J1xBLj+eSnlBdOc9UBhflAS6KS0+gL1/EDcOG0vnOGs8wp+6svW\nM/xn3uew/1pwtypRhV2HBByt7S1XtMLbbkffM73Qlf1Fewmvf8c+LZHPKej9\nVmw3YWB249rF/hE32wBSiunZkiQilRZGWRVNXUjJI6f4h9aFZm2JYHxlE+2W\nM0dA\r\n=8FHy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBlBQOI7fdIjbXLEJpgtfv3jG9IH2qpYqXyvgz3qDYIyAiAyvM+yHoLZWnn1sJX2A2CA+ngQXWC/5cApwb8+Kh3d8Q=="}],"size":39469,"noattachment":false,"key":"/speedline-core/-/speedline-core-1.4.3.tgz"},"maintainers":[{"name":"paulirish","email":"paul.irish@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/speedline-core_1.4.3_1595954255764_0.3529385489030701"},"_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":1595954255873,"_cnpm_publish_time":1595954255873,"dist-tags":{"latest":"1.4.3"}}