From 64b71294912070edc88d203d0b131cf3a9713d41 Mon Sep 17 00:00:00 2001 From: Felquis Date: Fri, 3 Feb 2017 14:19:22 -0200 Subject: [PATCH] Fix lint warnings --- lib/boleto.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/boleto.js b/lib/boleto.js index 073a017..7cf644f 100644 --- a/lib/boleto.js +++ b/lib/boleto.js @@ -1,4 +1,3 @@ -var fs = require('fs') var ejs = require('ejs') var formatters = require('./formatters') var barcode = require('./barcode') @@ -84,9 +83,13 @@ Boleto.prototype.renderHTML = function (callback) { renderOptions['boleto']['linha_digitavel_hash'] = hashString(renderOptions['boleto']['linha_digitavel']).toString() - var html = ejs.renderFile(__dirname + '/../assets/layout.ejs', renderOptions, { + ejs.renderFile(path.join(__dirname, '/../assets/layout.ejs'), renderOptions, { cache: true }, function (err, html) { + if (err) { + throw new Error(err) + } + callback(html) }) }