Skip to content

Commit

Permalink
Ensure folder
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewCallis committed Sep 3, 2019
1 parent 8f2575f commit 728d477
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 137 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AnalyticsProvider {
* @param {Object} config - A configuration object.
* @param {string} config.directory - The directory to store the JSON file containing the page view analytics.
* @param {string} [config.name] - The file name of the file containing the page view analytics.
* @param {string} [config.param] - The file extension of the file containing the page view analytics.
* @param {string} [config.extension] - The file extension of the file containing the page view analytics.
* @constructor
*/
constructor(config) {
Expand All @@ -34,6 +34,7 @@ class AnalyticsProvider {
...config,
};

FileUtility.ensureDirectorySync(this.config.directory);
this.pageVisits = FileUtility.readJSONSync(this.config.directory, this.config.name, this.config.extension);
}

Expand Down
Loading

0 comments on commit 728d477

Please sign in to comment.