{"_id":"11ty-fx-profiler","name":"11ty-fx-profiler","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"11ty-fx-profiler","version":"1.0.0","description":"Visualize how Eleventy spends its time using markers in the Firefox Profiler.","type":"module","main":"profiler.js","homepage":"https://github.com/fqueze/11ty-fx-profiler/","repository":{"type":"git","url":"git+https://github.com/fqueze/11ty-fx-profiler.git"},"author":{"name":"Florian Quèze"},"license":"MPL-2.0","dependencies":{"open":"^10.1.0"},"_id":"11ty-fx-profiler@1.0.0","gitHead":"0fce823cfa6a5fddf545e4516194b4b629a2bcf1","bugs":{"url":"https://github.com/fqueze/11ty-fx-profiler/issues"},"_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-jKkJ3DrrQgod+z2ua+/DKot3NvNQjlU+inj1HBsBDWTIVDnt0VVbqXWuWqS/wjh4XDt7Yiz5h1HnaoPeC3DDcA==","shasum":"964fc0d0794478239382431cbe5b3dfc0ecc1ca9","tarball":"https://registry.npmjs.org/11ty-fx-profiler/-/11ty-fx-profiler-1.0.0.tgz","fileCount":4,"unpackedSize":25059,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC9fzhyguSjxdQQCiuQ8CoeK9bhbz11X1yzgit+R3UVBAiBgOi0/xOJhq8aCtQ7WvvZ5zvfpmHTMbegyDobwqIi+SA=="}]},"_npmUser":{"name":"fqueze","email":"f.queze@gmail.com"},"directories":{},"maintainers":[{"name":"fqueze","email":"f.queze@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/11ty-fx-profiler_1.0.0_1714728534777_0.3930391433357159"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-03T09:28:54.775Z","1.0.0":"2024-05-03T09:28:54.940Z","modified":"2024-05-03T09:28:55.230Z"},"maintainers":[{"name":"fqueze","email":"f.queze@gmail.com"}],"description":"Visualize how Eleventy spends its time using markers in the Firefox Profiler.","homepage":"https://github.com/fqueze/11ty-fx-profiler/","repository":{"type":"git","url":"git+https://github.com/fqueze/11ty-fx-profiler.git"},"author":{"name":"Florian Quèze"},"bugs":{"url":"https://github.com/fqueze/11ty-fx-profiler/issues"},"license":"MPL-2.0","readme":"# 11ty-fx-profiler\nVisualize how Eleventy spends its build time using markers in the Firefox Profiler.\n\n## Usage\n\n`npm install 11ty-fx-profiler`, then in your `.eleventy.js` (or `eleventy.config.js`) file, add:\n- at the top: `import Profiler from '11ty-fx-profiler';`\n- in your code, to install the profiler: `Profiler(eleventyConfig);`. Put this as the first line of the fonction that takes `eleventyConfig` as a parameter. To avoid losing data, the profiler needs to be installed before anything else calls into `eleventyConfig.benchmarkManager`.\n\nThis profiler will do nothing unless the `PROFILE` environment variable is set when running eleventy.\n\nPossible values for the environment variable:\n- `open`: this will open the profile in a new tab in your default browser. This is the best for profiling during local development.\n- `stdout`: this will dump the entire profile JSON into the build log. Might be useful to profile what's happening when deploying.\n- any other value will be treated as a file name, and the profile will be saved to a file with that name.\n\nFor example, assuming you use `yarn build` to build your Eleventy website, you would use `PROFILE=open yarn build` to see a profile of it.\n\n## Adding more markers\n\nThe data already recorded by eleventy will be included, but it might be useful to include extra information for parts of your own code that could take time.\n\nFor example, if you have your own shortcode that you would like to instrument:\n```\n  eleventyConfig.addShortcode(\"shortcodename\", async function(string) {\n    let bench = eleventyConfig.benchmarkManager.get(\"User\").get(\"> shortcodename > \" + string);\n    bench.before();\n    /* ... */\n    bench.after();\n    return result;\n  });\n```\n","readmeFilename":"README.md"}