Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
feat(config): allowing custom package json path (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
henperez authored Jul 25, 2019
1 parent 07244a1 commit 3ebe077
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ metadata of the operations to Epsagon's infrastructure instead of the
operation's full data.
* `handlersDirName` - Customize the name of the directory epsagon stores its
handlers in. Do not use this option unless you know what you are doing :)
* `packageJsonPath` - Customize the path of your package.json (default ./package.json)

### Function Level Options
These options are defined at the function level, under the `epsagon` member
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const VALIDATE_LIB_BY_LANG = {
async node() {
let pack;
try {
pack = await fs.readJson(join(this.prefix, 'package.json'));
pack = await fs.readJson(this.config().packageJsonPath || (join(this.prefix, 'package.json')));
} catch (err) {
this.log('Could not read package.json. Skipping Epsagon library validation - please make sure you have it installed!');
return;
Expand Down

0 comments on commit 3ebe077

Please sign in to comment.