{"_id":"@brugmanjoost/stopwatch","_rev":"1-c799175870bcbac29b56da89f77e7216","name":"@brugmanjoost/stopwatch","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@brugmanjoost/stopwatch","version":"1.0.0","description":"A simple stopwatch for checking durations.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/brugmanjoost/stopwatch.git"},"keywords":["stopwatch"],"author":{"name":"Joost Brugman"},"license":"MIT","bugs":{"url":"https://github.com/brugmanjoost/stopwatch/issues"},"homepage":"https://github.com/brugmanjoost/stopwatch#readme","_id":"@brugmanjoost/stopwatch@1.0.0","gitHead":"f67d9e4ee24b1542e2787878d589743f922a9103","_nodeVersion":"20.7.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-5OFF1N5/83iTC4tRiv14MhF275Ka45rjlXGsBCF4Tf1RrSNBGpQgwj2w04g5F3g8mnMTswpkiw1wgtPCrhQ/9A==","shasum":"5e2e2fd94c256b3cafc7b549f6b6c3c5ccf22fa3","tarball":"https://registry.npmjs.org/@brugmanjoost/stopwatch/-/stopwatch-1.0.0.tgz","fileCount":4,"unpackedSize":3219,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCysVwl4FuazqOE07a0KsUbVtXOm7gyd4HLd2+har2Y4wIhAIlJyLrBx6MHhrkxXhWqIYBcoQO3nS3GV8IGR2kM9BXx"}]},"_npmUser":{"name":"brugmanjoost","email":"joost@brugmanholding.com"},"directories":{},"maintainers":[{"name":"brugmanjoost","email":"joost@brugmanholding.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stopwatch_1.0.0_1695244090684_0.3332192929983189"},"_hasShrinkwrap":false},"1.0.1":{"name":"@brugmanjoost/stopwatch","version":"1.0.1","description":"A simple stopwatch for checking durations.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/brugmanjoost/stopwatch.git"},"keywords":["stopwatch"],"author":{"name":"Joost Brugman"},"license":"MIT","bugs":{"url":"https://github.com/brugmanjoost/stopwatch/issues"},"homepage":"https://github.com/brugmanjoost/stopwatch#readme","_id":"@brugmanjoost/stopwatch@1.0.1","gitHead":"32e533f7dbc5a472aaa4de8ca0c47f7e6963640e","_nodeVersion":"20.7.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-Jn827evLCY+hiKeJcuc+bI6sXcL08zwhay2Kwr/L2/mk+7duN6bswXtyAcH5/LIXb0rGRZKLj2t2BpDJC2vyyA==","shasum":"deef9e824bda9fd0c8afdc0d7e1f49b2dd9bc382","tarball":"https://registry.npmjs.org/@brugmanjoost/stopwatch/-/stopwatch-1.0.1.tgz","fileCount":4,"unpackedSize":3235,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2fg4yGL44Xdyezg0D5jQXnvyCC3Bdacs0VThTBE50MwIgZjTP8I8hgvvBK96Kr4juV2IOhI1Qn3VHHKZmVbijGXY="}]},"_npmUser":{"name":"brugmanjoost","email":"joost@brugmanholding.com"},"directories":{},"maintainers":[{"name":"brugmanjoost","email":"joost@brugmanholding.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stopwatch_1.0.1_1695244383732_0.6971394946269514"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-20T21:08:10.554Z","1.0.0":"2023-09-20T21:08:10.871Z","modified":"2023-09-20T21:13:04.021Z","1.0.1":"2023-09-20T21:13:03.862Z"},"maintainers":[{"name":"brugmanjoost","email":"joost@brugmanholding.com"}],"description":"A simple stopwatch for checking durations.","homepage":"https://github.com/brugmanjoost/stopwatch#readme","keywords":["stopwatch"],"repository":{"type":"git","url":"git+https://github.com/brugmanjoost/stopwatch.git"},"author":{"name":"Joost Brugman"},"bugs":{"url":"https://github.com/brugmanjoost/stopwatch/issues"},"license":"MIT","readme":"# stopwatch\r\nA simple stopwatch for checking durations.\r\n\r\n<a name=\"#1\"></a>\r\n## 1. Installation\r\n\r\n```sh\r\n$ npm install @brugmanjoost/stopwatch\r\n```\r\n\r\n<a name=\"#2\"></a>\r\n## 2. Usage\r\n\r\n```\r\nconst Stopwatch = require('@brugmanjoost/stopwatch');\r\n\r\nlet stopwatch = new Stopwatch();\r\nstopwatch.start();\r\n\r\nlet i = setInterval(() => {\r\n    console.log(`${stopwatch.duration}ms has passed`);\r\n}, 500);\r\n\r\nsetTimeout(() => {\r\n    console.log(`Stopping stops the counter. Duration is preserved.`);\r\n    stopwatch.stop();\r\n}, 3000);\r\n\r\nsetTimeout(() => {\r\n    console.log(`Starting again continues the counter.`);\r\n    stopwatch.start();\r\n}, 4500);\r\n\r\nsetTimeout(() => {\r\n    console.log(`Resetting sets the duration back to 0.`);\r\n    stopwatch.reset();\r\n}, 6000);\r\n\r\nsetTimeout(() => {\r\n    console.log(`That's all there is.`);\r\n    clearInterval(i);\r\n}, 8000);\r\n\r\n```\r\n","readmeFilename":"README.md"}