{"_id":"p-other-data","_rev":"1-98c2144bf072ff1294c80f12279c9ce0","name":"p-other-data","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"p-other-data","version":"0.3.0","license":"MIT","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","start":"tsc -w --preserveWatchOutput","test":"jest --passWithNoTests","release":"yarn build && yarn test && beachball publish","checkchange":"beachball check","change":"beachball change"},"repository":{"url":"git+https://github.com/microsoft/p-profiler.git"},"devDependencies":{"@types/jest":"^25.2.1","@types/node":"^14.0.5","beachball":"^1.31.0","jest":"^25.5.3","ts-jest":"^25.4.0","typescript":"^3.8.3"},"gitHead":"2d1eb97758be7c3f2ddd3a0d471b41f3e32b959a","description":"Run a promise (perhaps with p-queue) generating a profiler json suitable to be consumed inside Chrome or Edge devtools to be analyzed","bugs":{"url":"https://github.com/microsoft/p-profiler/issues"},"homepage":"https://github.com/microsoft/p-profiler#readme","_id":"p-other-data@0.3.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-uwHfyxgL8bXpaQxOB5Amt9DkxXLrXc5xCe06RRBaGqty8tZlJ/QykGaZM/VkOdGAgzTzgPTFdO8mt8PXg47JCw==","shasum":"cfcb6a4b10ef7bb35ef4842afb3870313662313e","tarball":"https://registry.npmjs.org/p-other-data/-/p-other-data-0.3.0.tgz","fileCount":16,"unpackedSize":22293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOtoFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHGQ/9GcKoYoKzk78V6vOXoK0uztqombiMEihzhVtRLkl8mt83Kyxd\r\nrPTi52mvySc+NX9dei6MdJHGJWMSihV8v40w8ODI2aP/GbwSNJYeoRwwP9/p\r\nJlWdRUUow6W+0v5vuo0LLwDfb/zz5s6OGS1gC/svVYXrHg4YQBvh1DGrg3NV\r\nnGtceWezfw9m14dpw95j0fBZso7lX3+344uHwusknDZ8xyWPPgKrOtnuFXUt\r\nVXDAU7gRd1cUGDdyRbWCpK2uRF4oH0QaIrgk8bReOXySMiZ5j39BxXNluvEs\r\nqoVGEX7zHuYV5UxBI/q9BdvpJ7OLNxslhdCZUnJjXPpM8mobkicQCXmRsjxA\r\nw2by6Aj0bG1/5KwMv1OpkALxawcRJCTlvK7Guk419deyvWRif3+iGXvaDBmh\r\njcPzvLsfqIarlQBBtzV0PL3P/Cilj2VxcM/SoOZxIqoZbKldpUImnUn0DYbg\r\n+JVUSuqitUnmXeXu93tHF5XftfYkavlEHeoE3qfQ3fuzi2u5h/Rga39+6fbU\r\n+LcWdgLyWTlu4BTdMtbQINZCta8GYhqEOwnAONsSLZIF/Zp2m6cBlX7JeRUJ\r\naKN64AKI9EIso2DjV1m5Bd0ZlVbo1RiNIhLrBn1Y4x9A5Ha/DKmVRLN7/a/d\r\n82IigmK/q5BtJwHfPpJnZtjIg47APW3+vi4=\r\n=S5Jg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNrzd6hGSE4wqDcYT5RCQM4jopDVwlMMgWhf7b59QwcgIhAJfm8ctCObeTLHgO7DdSTPUzT4BPsfdFYuaW3u12Y0D8"}]},"_npmUser":{"name":"ronakjain-public","email":"ronakjain.public@gmail.com"},"directories":{},"maintainers":[{"name":"ronakjain-public","email":"ronakjain.public@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-other-data_0.3.0_1648024069467_0.35316904979231944"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-23T08:27:49.466Z","0.3.0":"2022-03-23T08:27:49.828Z","modified":"2022-05-12T10:31:50.201Z"},"maintainers":[{"name":"ronakjain-public","email":"ronakjain.public@gmail.com"}],"description":"Run a promise (perhaps with p-queue) generating a profiler json suitable to be consumed inside Chrome or Edge devtools to be analyzed","homepage":"https://github.com/microsoft/p-profiler#readme","repository":{"url":"git+https://github.com/microsoft/p-profiler.git"},"bugs":{"url":"https://github.com/microsoft/p-profiler/issues"},"license":"MIT","readme":"# p-profiler\r\n\r\nRun a promise (perhaps with p-queue) generating a profiler json suitable to be consumed inside Chrome or Edge devtools to be analyzed\r\n\r\n## Install\r\n\r\n```\r\n$ npm install p-profiler\r\n```\r\n\r\n## Usage\r\n\r\nThe p-profiler library is a class. Simply instantiate a `Profiler` class to be used to run the task functions (functions that generate a Promise). This example uses `p-graph` to demonstrate how to use this library. The task functions in this example is wrapped inside a profiler and a promise queue to control concurrency\r\n\r\n```js\r\nimport Profiler from \"p-profiler\";\r\nimport pGraph from \"p-graph\";\r\nimport PQueue from \"p-queue\";\r\n\r\nconst concurrency = 3;\r\n\r\n// Create a profiler with the same concurrency as the p-graph\r\nconst profiler = new Profiler({ concurrency });\r\nconst queue = new PQueue({ concurrency });\r\n\r\nconst putOnShirt = () =>\r\n  queue.add(profiler.run(() => Promise.resolve(\"put on your shirt\")));\r\nconst putOnShorts = () =>\r\n  queue.add(profiler.run(() => Promise.resolve(\"put on your shorts\")));\r\nconst putOnJacket = () =>\r\n  queue.add(profiler.run(() => Promise.resolve(\"put on your jacket\")));\r\nconst putOnShoes = () =>\r\n  queue.add(profiler.run(() => Promise.resolve(\"put on your shoes\")));\r\nconst tieShoes = () =>\r\n  queue.add(profiler.run(() => Promise.resolve(\"tie your shoes\")));\r\n\r\nconst graph = [\r\n  [putOnShoes, tieShoes],\r\n  [putOnShirt, putOnJacket],\r\n  [putOnShorts, putOnJacket],\r\n  [putOnShorts, putOnShoes],\r\n];\r\n\r\nawait pGraph(graph).run(); // returns a promise that will resolve when all the tasks are done from this graph in order\r\n\r\n// This writes out a\r\nprofiler.output();\r\n```\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","readmeFilename":"README.md"}