{"name":"progress-estimator","version":"0.3.1","description":"Animated progress bars with estimated durations","author":{"name":"Brian Vaughn","email":"brian.david.vaughn@gmail.com"},"license":"MIT","main":"src/index.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/bvaughn/progress-estimator.git"},"bugs":{"url":"https://github.com/bvaughn/progress-estimator/issues"},"scripts":{"lint":"eslint 'src/**/*.js' && tsc --project types","prettier":"prettier --write 'src/**/*.js' 'types/**/*.ts'"},"keywords":["ascii","busy","cli","console","duration","idle","indicator","list","loading","progress","promise","task","term","terminal","timing","unicode","wait"],"dependencies":{"chalk":"^2.4.1","cli-spinners":"^1.3.1","humanize-duration":"^3.15.3","log-update":"^2.3.0"},"devDependencies":{"babel-eslint":"^10.0.1","eslint":"^5.9.0","eslint-config-prettier":"^3.3.0","eslint-plugin-prettier":"^3.0.0","prettier":"^1.15.2","typescript":"^3.1.6"},"gitHead":"d46de53086586612bbe5016496424bfde5da26ea","homepage":"https://github.com/bvaughn/progress-estimator#readme","_id":"progress-estimator@0.3.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-I5bwE35adOrA2rfZ9iHHPESUp5C6cXrZd0J8LdFD9J+66ijSugBwZHooPCROf94Ox8YZaUyvTLViqSiRvBhSoA==","shasum":"5a4c5bffa2cca09ac233c43bb6a644cbe6706920","tarball":"http://registry-npm.ywwl.com/progress-estimator/download/progress-estimator-0.3.1.tgz","fileCount":11,"unpackedSize":13360,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+oGNAYh5fUe5IQi1cTSIUs+CFKuZuJI9+M/75Cx/PCQIhALrFJBs/q/kGK9LMLCNY4hBp38Yf5cn7wXt9/gG/nONM"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPZjxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwEw//SFk90uGa7pEuyc3enw9O/FWHuvw4AE9YEHuoDNwEHw7QmOLl\r\nIUG3QiLZ6GW7ONLWHIdcZoqdBENH7fxabwn8F/ZBPh5kd5oKUh6qT+LXCc1O\r\nArCrIh9m8LwGmLH4svRDqsloAqVAkwUBJggjOB1NjOhgSLb7Lco2lrxZgC1v\r\nD4QAfH44oOoVE5D2hfvZaa6Vo3p+cztrLyr0wIOdAqPzPUQNVjROa5AuzyAi\r\n6Pgk2KOh0O83SWfuyU3DqE3J2ZgGgPHr0CWWvqq+9vzbVNFkXLhPrzhMsVSR\r\npqPPLgF3CBgl6pU84rH+HfPXoicNIhtZ/6D37TJXY2DiM3kAewaQPJc44bbL\r\nEm1mhQgKQg2EbQz1ow2qf7a2F9J4dqpAQDmJcAdb6b0WLZlfoiiGfLlKV5Db\r\n04aQ8Afhkv3lt0kfaAXRDK8UfW1SLoEGwRrEHY6TpX5Tgqv5R3NiEIsEd2jx\r\nSB3CUJ8y6nBbVF+WIs/TMUMzDiIJrgaXZJTzfHpM+eC79hixGRxjjdKnP84a\r\nV9Y85oJueGO7U33J3uTk3Bz4ANruBw21SvAHCoCeUr/7FK9jXVvg6KxCRbwY\r\nk43/zXPGk4PJwONkz7u9JxoJmfHRwR09t/Wogwl7nhsSm13g55XeVQ2eUgAT\r\nLeFnyJL4jchjDxZHXksblbQl4bNEpqYGn14=\r\n=ptC8\r\n-----END PGP SIGNATURE-----\r\n","size":4760,"noattachment":false,"key":"/progress-estimator/-/progress-estimator-0.3.1.tgz"},"_npmUser":{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"},"directories":{},"maintainers":[{"name":"brianvaughn","email":"briandavidvaughn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/progress-estimator_0.3.1_1681758449631_0.4818675082203645"},"_hasShrinkwrap":false,"readme":"# progress-estimator\n\nLogs a progress bar and estimation for how long a Promise will take to complete. This library tracks previous durations in order to provide more accurate estimates over time.\n\n![Demo](https://user-images.githubusercontent.com/29597/48986949-474e2400-f0cf-11e8-86d7-d201f8ad8eca.gif)\n\n### 🎉 [Become a sponsor](https://github.com/sponsors/bvaughn/) or ☕ [Buy me a coffee](http://givebrian.coffee/)\n\n## Installation\n\n```shell\n# use npm\nnpm install progress-estimator\n\n# use yarn\nyarn add progress-estimator\n```\n\n## Usage example\n\n```js\nconst createLogger = require('progress-estimator');\nconst { join } = require('path');\n\n// All configuration keys are optional, but it's recommended to specify a storage location.\n// Learn more about configuration options below.\nconst logger = createLogger({\n  storagePath: join(__dirname, '.progress-estimator'),\n});\n\nasync function run() {\n  await logger(promiseOne, \"This is a promise\");\n  await logger(\n    promiseTwo,\n    \"This is another promise. I think it will take about 1 second\",\n    {\n      estimate: 1000\n    }\n  );\n}\n```\n## API\n\n### `createLogger(optionalConfiguration)`\n\nThis method is the default package export. It creates and configures a logger function (documented below). The following configuration options are supported. (They apply only to the logger instance that's returned.)\n\n| name | type | Description |\n| --- | --- | --- |\n| `logFunction` | Function | Custom logging function. Defaults to [`log-update`](https://npmjs.com/package/log-update). Must define `.done()` and `.clear()` methods. |\n| `spinner` | object | Which spinner from the [`cli-spinners`](https://npmjs.com/package/cli-spinners) package to use. Defaults to `dots`. |\n| `storagePath` | string | Where to record durations between runs. Defaults to [`os.tmpdir()`](https://nodejs.org/api/os.html). |\n| `theme` | object | Custom [`chalk`](https://npmjs.com/package/chalk) theme. Look to the [default theme](https://github.com/bvaughn/progress-estimator/blob/master/src/theme.js) for a list of required keys. |\n\n### `logger(promise, labelString, options)`\n\nThis method logs a progress bar and estimated duration for a promise. It requires at least two parameters– a `Promise` and a label (e.g. \"Running tests\"). The label is SHA1 hashed in order to uniquely identify the promise.\n\nAn optional third parameter can be provided as well with the following keys:\n\n| name | type | Description |\n| --- | --- | --- |\n| `estimate` | Number | Estimated duration of promise. (This value is used initially, until a history of actual durations have been recorded.) |\n| `id` | String | Uniquely identifies the promise. This value is needed if the label string is not guaranteed to be unique. |\n","publish_time":1681758449836,"_cnpm_publish_time":1681758449836,"dist-tags":{"latest":"0.3.1"}}