{"versions":{"1.0.0":{"name":"fake-progress","version":"1.0.0","description":"Fake a progress bar using an exponential progress function","main":"index.js","scripts":{"test":"xo && test/test.js"},"repository":{"type":"git","url":"git+https://github.com/piercus/fake-progress.git"},"keywords":["progress","fake"],"author":{"name":"Pierre Colle"},"license":"MIT","bugs":{"url":"https://github.com/piercus/fake-progress/issues"},"homepage":"https://github.com/piercus/fake-progress#readme","devDependencies":{"assert":"^1.4.1","vows":"^0.8.1","xo":"^0.18.1"},"gitHead":"210aae52d83b3881ed3e2dc1990763d97d18240f","_id":"fake-progress@1.0.0","_shasum":"aaef430614f57e3ac7fbc28bd500ebd31b58472e","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.3","_npmUser":{"name":"anonymous","email":"piercus@gmail.com"},"maintainers":[{"name":"anonymous","email":"piercus@gmail.com"}],"dist":{"shasum":"aaef430614f57e3ac7fbc28bd500ebd31b58472e","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fake-progress/-/fake-progress-1.0.0.tgz","integrity":"sha512-rzdTbG+gDjB2mC/LkmnUtobAnx5RK6WuiQs3paSpNYZlWpUy/IGFmAZBoW4g5g+rQgOLKAchcQPP9jWN2XM11Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFk02w8D8yqK3dlyCYi61CW1S3+J4ZDA+VP7G3DA/5I9AiEA2Ae0DUHvPNsKrszXJxIJ2JmWBmoUhBX9cf9R0hoXY0k="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/fake-progress-1.0.0.tgz_1491416401287_0.806310492567718"},"directories":{},"contributors":[]},"1.0.1":{"name":"fake-progress","version":"1.0.1","description":"Fake a progress bar using an exponential progress function","main":"index.js","scripts":{"test":"xo && node test/test.js"},"repository":{"type":"git","url":"git+https://github.com/piercus/fake-progress.git"},"keywords":["progress","fake"],"author":{"name":"Pierre Colle"},"license":"MIT","bugs":{"url":"https://github.com/piercus/fake-progress/issues"},"homepage":"https://github.com/piercus/fake-progress#readme","devDependencies":{"assert":"^1.4.1","vows":"^0.8.1","xo":"^0.18.1"},"gitHead":"63bd7cb21b9c0ee5134f3b9db15b36b5cd11b2ed","_id":"fake-progress@1.0.1","_shasum":"a86e3fbb0a8c5ae77260be02ae05c8048875ff8e","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.3","_npmUser":{"name":"anonymous","email":"piercus@gmail.com"},"maintainers":[{"name":"anonymous","email":"piercus@gmail.com"}],"dist":{"shasum":"a86e3fbb0a8c5ae77260be02ae05c8048875ff8e","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fake-progress/-/fake-progress-1.0.1.tgz","integrity":"sha512-4HrMYRTfVHncORcM5yepApRd8RIW76Fv6I1XZCHXbGkR9983qu821gcbbWDQjlvbO25ZOGSf5PzRMH/fhoQxJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJT9qsCQh3yjoYzEEqrjhs3EBRla9azzX9A/7OuLf0kAIhAOpXvMMF3lQMCxTDtCTEkDsb/DC1yGEQdUQKwSFs1zlM"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/fake-progress-1.0.1.tgz_1491552109083_0.13875766634009778"},"directories":{},"contributors":[]},"1.0.2":{"name":"fake-progress","version":"1.0.2","description":"Fake a progress bar using an exponential progress function","main":"index.js","scripts":{"test":"xo && node test/test.js"},"repository":{"type":"git","url":"git+https://github.com/piercus/fake-progress.git"},"keywords":["progress","fake"],"author":{"name":"Pierre Colle"},"license":"MIT","bugs":{"url":"https://github.com/piercus/fake-progress/issues"},"homepage":"https://github.com/piercus/fake-progress#readme","devDependencies":{"assert":"^1.4.1","vows":"^0.8.1","xo":"^0.18.1"},"gitHead":"0e44205d95311a8a565268e545af3d7d3672ecad","_id":"fake-progress@1.0.2","_shasum":"0bc05f06d11198c403471eec81691b0030a31630","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.3","_npmUser":{"name":"anonymous","email":"piercus@gmail.com"},"maintainers":[{"name":"anonymous","email":"piercus@gmail.com"}],"dist":{"shasum":"0bc05f06d11198c403471eec81691b0030a31630","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fake-progress/-/fake-progress-1.0.2.tgz","integrity":"sha512-AsoONIx2onxi7QwohTD7a/XErS+qucqa1bQCQ1ODc+k3fHL2Q1t8Gj3ZwfbMoFuAm2gkW5X69sg5zHjdyphmaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCG9c2Eey+XayWvTA7YcmU62jCz5adqbWLtRZlMSfMjxAIgZKasoa+pTMfT5uHiyg2qrUIk7X6dWFfoeb23nXAz5T4="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/fake-progress-1.0.2.tgz_1492710896631_0.7928452894557267"},"directories":{},"contributors":[]},"1.0.3":{"name":"fake-progress","version":"1.0.3","description":"Fake a progress bar using an exponential progress function","main":"index.js","scripts":{"test":"xo && node test/test.js"},"repository":{"type":"git","url":"git+https://github.com/piercus/fake-progress.git"},"keywords":["progress","fake"],"author":{"name":"Pierre Colle"},"license":"MIT","bugs":{"url":"https://github.com/piercus/fake-progress/issues"},"homepage":"https://github.com/piercus/fake-progress#readme","devDependencies":{"assert":"^1.4.1","vows":"^0.8.1","xo":"^0.18.1"},"gitHead":"932344b99ffb7a3ba2662b2e39e1b7b590bc2c9c","_id":"fake-progress@1.0.3","_shasum":"d6558fdfc48378c45c2aa39888a94217961be5a9","_from":".","_npmVersion":"4.4.1","_nodeVersion":"7.7.3","_npmUser":{"name":"anonymous","email":"piercus@gmail.com"},"maintainers":[{"name":"anonymous","email":"piercus@gmail.com"}],"dist":{"shasum":"d6558fdfc48378c45c2aa39888a94217961be5a9","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fake-progress/-/fake-progress-1.0.3.tgz","integrity":"sha512-SQ3aRIN7p4hFAdLfm4kiNQpfqn4ljsvmL1sXmxnvojlAHAgrtYSiYlj0Yb0tN+Kqco75Oi+gzsSod2mllL5iCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5zsVIpacdLJ4XSRGmfubq9+BOSNp4eMM9f4uvi0hqYAiAtjo7CYuKOOEsl3nQrbk+odoKwtqqzwatEjZQ/D3nI5Q=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fake-progress-1.0.3.tgz_1503484216588_0.22463957546278834"},"directories":{},"contributors":[]},"1.0.4":{"name":"fake-progress","version":"1.0.4","description":"Fake a progress bar using an exponential progress function","main":"index.js","scripts":{"test":"xo && node test/test.js"},"repository":{"type":"git","url":"git+https://github.com/piercus/fake-progress.git"},"keywords":["progress","fake","spinner","percentage","simulate","elegant","loading","busy"],"author":{"name":"Pierre Colle"},"license":"MIT","bugs":{"url":"https://github.com/piercus/fake-progress/issues"},"xo":{"rules":{"object-shorthand":["error","never"]}},"homepage":"https://github.com/piercus/fake-progress#readme","devDependencies":{"assert":"^1.4.1","vows":"^0.8.1","xo":"^0.18.1"},"gitHead":"71878673278ed51124ca7b06ea059409b49dbb92","_id":"fake-progress@1.0.4","_shasum":"366bd2c04a5545300e32392371df0aa456141d1d","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.13.0","_npmUser":{"name":"anonymous","email":"piercus@gmail.com"},"maintainers":[{"name":"anonymous","email":"piercus@gmail.com"}],"dist":{"shasum":"366bd2c04a5545300e32392371df0aa456141d1d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fake-progress/-/fake-progress-1.0.4.tgz","integrity":"sha512-RIkSoOt6Aq6ZgCHEsm/MTH9RTrjY3lVEF9q+n5Qx+LVyS4ziQpijIHf2SKVIzTKEXA40D2Zps1duXfGvUioB3A==","fileCount":11,"unpackedSize":44717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbu4grCRA9TVsSAnZWagAAf6wP/iPsfEff+IEIuU0CsFv2\n+hq6xQjxXqMPY4ac8GSj+9b9XhsSo5gclCoM3RLEmHZz4nBdG948vTuJSqTN\ncvXoS6rnO7af9ORW55dAF+wkUzL/Z037dvn/e/iARJBWfh3f399N655BQZik\nxISYuNuuxtAbS0TyPkNNGzFJM9HQNTAqteXtKl7VLQ8XyuaZ0T18zC5kOVmo\n10SXq7wJI6Xll50jXCUlnLqyDMNxbtoLRi33k59JY25sFcOIiYJeGBJYWy6C\nIvBXuNFqC1hip7hgWC3v5puBPc/PznPv72dvQz/jXcD72uV1Q/qgz2RNzQsG\nOOhOukXuUGwniAqwvrHum3dgOEGmZK/XK3eXw2CCtVFPmgw+Uxki8eUYx+Do\nFtqwOrzg0Xn3DqaMfoEjjVFvz4Wh9NSgKaR/maRpQuPo1CECrD0CMDgcx/6/\ny+RuvrOW3nClLwGgHzTUL4ulSSk+QE+++Y0ZoGKnA3wiS7OlHEjlBQ3KvQgT\nu3cq7QybKEBDu69ZYBthrAdAUPkDMqJHM01f22mDX5Uyeua+II/V51GCHnul\nG2yIxIXjdoFCIhITsBbwZqCOm1c9InFlE4lId+A799UQ9GKhlsO9rk7ngCjK\nK9dBbTvL9ntG4OEuQRBpqWc9PQsX2MWPXdj8ZXh9AaAKylDjU5xp17b/vNwh\nwkD3\r\n=1B2D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXrmUMEeV1F1jPMczkonpiEklgtJTRYE31xoSlmr00ZAiEAmg4dLDMjmbPJ6UWXFrLBWhHiFffup0xhjq6XZw0CgTE="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fake-progress_1.0.4_1539016746326_0.6315675073360298"},"_hasShrinkwrap":false,"contributors":[]}},"dist-tags":{"latest":"1.0.4"},"name":"fake-progress","time":{"modified":"2023-07-31T04:01:24.176Z","created":"2022-01-26T19:54:03.560Z","1.0.0":"2017-04-05T18:20:03.185Z","1.0.1":"2017-04-07T08:01:51.164Z","1.0.2":"2017-04-20T17:54:57.188Z","1.0.3":"2017-08-23T10:30:17.527Z","1.0.4":"2018-10-08T16:39:06.505Z"},"readme":"![Travis build status](https://www.travis-ci.org/piercus/fake-progress.svg?branch=master)\n# Fakeprogress\n\nSimulate smooth progression easily and combine real progression and fake progression.\n\n## Install\n\n```\nnpm install fake-progress\n```\n\n## Basic example\n\n```js\nvar FakeProgress = require(\"fake-progress\");\n\n// Create the fake progress with a timeConstant of 10 seconds\n// it means that :\n//  after 10 seconds, progress will be 0.6321 ( = 1-Math.exp(-1) )\n//  after 20 seconds, progress will be 0.8646 ( = 1-Math.exp(-2) )\n//  and so one\nvar p = new FakeProgress({\n\ttimeConstant : 10000,\n\tautoStart : true\n});\n\nvar exampleAsyncFunction = function(callback){\n\tsetTimeout(function(){\n\t\tcallback()\n\t},30000)\n};\n\nvar onEachSecond = function(){\n\tconsole.log(\"Progress is \"+(p.progress*100).toFixed(1)+\" %\");\n};\n\nvar interval = setInterval(onEachSecond, 1000);\n\nvar onEnd = function(){\n\tp.end();\n\tclearInterval(interval);\n\tconsole.log(\"Ended. Progress is \"+(p.progress*100).toFixed(1)+\" %\")\n};\n\nexampleAsyncFunction(onEnd);\n```\n\nwill print\n\n```\nProgress is 8.6 %\nProgress is 17.3 %\nProgress is 25.2 %\nProgress is 32.3 %\n...\n```\n\nThe chart of progression over time.\n\n![Chart of progress](./example.png)\n\nUntil the end is triggered, the progression is following the exponential curve, once \"end\" is triggered, progression goes to 100%.\n\n## More complex\n\nIn this example we will mix 3 functions, A and C are classical async functions, B is an async function with a 'real' callback.\n\n\n### Create 2 async function a, c\n\na and c are 2 basic async functions without progress.\n```js\nconst a = function (cb) {\n\tsetTimeout(() => {\n\t\tcb();\n\t}, 1000);\n};\n\nconst c = function (cb) {\n\tsetTimeout(() => {\n\t\tcb();\n\t}, 3000);\n};\n```\n\n### Create a class for event emitter with linear progress\n\nb will be an instance of an event emmiter that has a progress event\n\n```js\nconst B = function () {\n\tEventEmitter.call(this);\n\n\tlet count = 0;\n\tconst self = this;\n\tconst totalCount = 30;\n\tself.emit('start', count / totalCount);\n\tself._intervalId = setInterval(() => {\n\t\tcount++;\n\t\tif (count >= totalCount) {\n\t\t\tself.emit('end', count / totalCount);\n\t\t\tclearInterval(self._intervalId);\n\t\t} else {\n\t\t\tself.emit('progress', count / totalCount);\n\t\t}\n\t}, 100);\n};\n\nutil.inherits(B, EventEmitter);\n```\n\n### Create a fake progress and log his value over time\n\n```js\nconst p = new FakeProgress({});\n\nconst onEachDeciSecond = function () {\n\tconsole.log('Progress is ' + (p.progress * 100).toFixed(1) + ' %');\n};\n\nonEachDeciSecond();\n\nconst interval = setInterval(onEachDeciSecond, 100);\n```\n\n### Create sub progress bar of p, for a progress\n\nA has no progress so we fake his progress.\nA succeed in 1000 ms, so we can consider 500 ms is a good timeConstant.\n\n```js\nconst aProgress = p.createSubProgress({\n\ttimeConstant: 500,\n\tend: 0.3,\n\tautoStart: true\n});\n```\n\n\n### Call async chain\n\nEach time on the async chain, subProgress.stop() then call createSubProgress() to create a new subProgress.\n\n```js\na(err => {\n\tif (err) {\n\t\tthrow (err);\n\t}\n\taProgress.stop();\n\tconst bProgress = p.createSubProgress({\n\t\tend: 0.8\n\t});\n\tconst b = new B();\n\n\tb.on('progress', progress => {\n\t\tbProgress.setProgress(progress);\n\t});\n\n\tb.on('end', () => {\n\t\tbProgress.stop();\n\t\tconst cProgress = p.createSubProgress({\n\t\t\ttimeConstant: 1000,\n\t\t\tautoStart: true\n\t\t});\n\t\tc(() => {\n\t\t\tcProgress.end();\n\t\t\tonEachDeciSecond();\n\t\t\tclearInterval(interval);\n\t\t});\n\t});\n});\n```\n\n### Call everything\n\nAfter each call, stop previous sub, and create a new subProgress for next request.\n\n```js\na(function(){\n\taProgress.stop();\n\tvar bProgress = p.createSubProgress({\n\t\tend : 0.8\n\t});\n\tvar b = new B();\n\n\tb.on('progress', function(progress){\n\t\tbProgress.setProgress(progress);\n\t});\n\n\tb.on('end', function(){\n\t\tbProgress.stop();\n\t\tvar cProgress = p.createSubProgress({\n\t\t\ttimeConstant : 1000,\n\t\t\tautoStart : true\n\t\t});\n\t\tc(function(){\n\t\t\tcProgress.end()\n\t\t\tonEachDeciSecond()\n\t\t\tclearInterval(interval);\n\t\t})\n\t});\n});\n```\n\n### All together\n\nsee [source](./test/complex-example.js)\n\n### Results\n\n![Chart of progress](./complexExample.png)\n\n## Documentation\n\nSee inside the code, documentated using JSDoc","users":{}}