Created
December 24, 2018 10:38
-
-
Save evanxg852000/f803feae6d0d7fea3dc769b6b4de6bdd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Templater { | |
... | |
constructor(dir, cached){ | |
this._dir = path.resolve(dir) | |
this._cached = cached || false | |
this._compiledDir = path.join(this._dir, '.tmp') | |
// create compiled directory if not exist | |
if(!fs.existsSync(this._dir)){ | |
throw Error('Template directory does not exist') | |
} | |
if (!fs.existsSync(this._compiledDir)) { | |
fs.mkdirSync(this._compiledDir) | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment