diff --git a/README.md b/README.md index 60399d9..e778b4e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Run a promise (perhaps with p-queue) generating a profiler json suitable to be c ## Install ``` -$ npm install p-profile +$ npm install p-profiler ``` ## Usage diff --git a/src/index.ts b/src/index.ts index 1392671..b3237d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -77,8 +77,12 @@ export default class Profiler { }); } + /** + * Writes out the profiler.json and returns the output path + */ output() { - return fs.writeFileSync(this.outputPath, JSON.stringify(this.events)); + fs.writeFileSync(this.outputPath, JSON.stringify(this.events)); + return this.outputPath; } }