From c9682b8128a28ba203264c1bb213bfcad38caf1c Mon Sep 17 00:00:00 2001 From: Ken Chau Date: Mon, 25 May 2020 14:47:35 -0700 Subject: [PATCH] return output path --- README.md | 2 +- src/index.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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; } }