Comparing version 0.1.7 to 0.1.8
@@ -7,2 +7,3 @@ 'use strict'; | ||
var util = require('util'); | ||
var path = require('path'); | ||
var escape = _interopDefault(require('lodash.escape')); | ||
@@ -98,3 +99,3 @@ var unescape = _interopDefault(require('lodash.unescape')); | ||
const createFromFileSystem = filename => { | ||
return read(filename).then(content => compile(content)); | ||
return read(path.path.resolve(filename)).then(content => compile(content)); | ||
}; | ||
@@ -128,3 +129,3 @@ | ||
const createLayoutFromFilePath = () => { | ||
return read(filePath).then(layoutContents => compileTemplate(layoutContents)); | ||
return read(path.path.resolve(filePath)).then(layoutContents => compileTemplate(layoutContents)); | ||
}; | ||
@@ -131,0 +132,0 @@ |
{ | ||
"name": "backticks", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Express engine creator for the basic use of ES6 template literals (backticks) for templating", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -7,3 +7,3 @@ export default { | ||
}, | ||
external: ['lodash.escape', 'lodash.unescape', 'lodash.merge', 'fs', 'util'] | ||
external: ['lodash.escape', 'lodash.unescape', 'lodash.merge', 'fs', 'util', 'path'] | ||
}; |
import { readFile } from "fs"; | ||
import { promisify } from "util"; | ||
import { path } from "path"; | ||
import html from "./htmlTemplate"; | ||
@@ -20,3 +21,3 @@ import { createEscapeWrapper } from "./utils"; | ||
const createFromFileSystem = filename => { | ||
return read(filename).then(content => compile(content)); | ||
return read(path.resolve(filename)).then(content => compile(content)); | ||
}; | ||
@@ -50,3 +51,3 @@ | ||
const createLayoutFromFilePath = () => { | ||
return read(filePath).then(layoutContents => compileTemplate(layoutContents)); | ||
return read(path.resolve(filePath)).then(layoutContents => compileTemplate(layoutContents)); | ||
}; | ||
@@ -53,0 +54,0 @@ |
23591
576