🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ajs

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajs - npm Package Compare versions

Comparing version

to
1.2.0

17

lib/index.js

@@ -183,3 +183,15 @@ "use strict";

*/
ajs.renderFile = function (path, opts, callback) {
ajs.renderFile = function (path, data, opts, callback) {
if (typeof data === "function") {
callback = data;
opts = {};
} else if (typeof opts === "function") {
callback = opts;
opts = {};
}
opts = opts || {};
opts.locals = data;
ajs.compileFile(path, opts, function (err, template) {

@@ -193,2 +205,5 @@ if (err) {

// Alias for express rendering
ajs.__express = ajs.renderFile;
/**

@@ -195,0 +210,0 @@ * compileFile

2

package.json

@@ -14,3 +14,3 @@ {

],
"version": "1.1.0",
"version": "1.2.0",
"author": "Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)",

@@ -17,0 +17,0 @@ "contributors": [

@@ -27,2 +27,10 @@ "use strict";

});
t.should("render " + name + " templates (renderFile)", function (cb) {
ajs.renderFile(files.inputAjs.path, require(files.inputJs.path), function (err, data) {
err && console.log(err.stack);
t.expect(err).toBe(null);
t.expect(data).toBe(readFile(files.outputHtml.path));
cb();
});
});
});

@@ -29,0 +37,0 @@