mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 22:10:41 -07:00
refactor: move fs util into template.js
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import fs from 'fs'
|
||||
|
||||
export function readFileAsync (filepath) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
fs.readFile(filepath, 'utf8', function (err, content) {
|
||||
err ? reject(err) : resolve(content)
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
export function statFileAsync (path) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
fs.stat(path, (err, stat) => err ? reject(err) : resolve(stat))
|
||||
})
|
||||
};
|
||||
Reference in New Issue
Block a user