New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ajs

Package Overview
Dependencies
Maintainers
1
Versions
31
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 1.1.0 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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc