Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

render.javascript

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

render.javascript - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

26

package.json
{
"description": "Render.js | Template Engine for Express",
"keywords": [
"render",
"js",
"javascript",
"template",
"engine",
"express",
"nodejs"
"render",
"js",
"javascript",
"template",
"engine",
"express",
"nodejs"
],
"authors": [
{ "name": "clqu", "email": "me@clqu.live" },
{ "name": "Swôth", "email": "me@swoth.xyz" }
{
"name": "clqu",
"email": "me@clqu.live"
},
{
"name": "Swôth",
"email": "me@swoth.xyz"
}
],

@@ -19,3 +25,3 @@ "license": "Apache-2.0",

"name": "render.javascript",
"version": "0.1.1"
"version": "0.1.2"
}

@@ -9,4 +9,4 @@ const version = require('../package.json').version;

let head = "let str = '';with(obj){str+=`",
tail = "`; return str;}";
tail = "`; return str;}";
const variable = /\{\{([^}]+)\}\}/g;

@@ -24,4 +24,4 @@ const expression = /\{\%([^%]+)\%\}/g;

'<!-- \n' +
' rendered by render.js@' + version + ' \n' +
' npmjs.com/package/render.js \n' +
' rendered by render.javascript@' + version + ' \n' +
' npmjs.com/package/render.javascript \n' +
'-->'

@@ -31,11 +31,17 @@ ) : '') + fn(Object.assign(data, {

let parts = filePath.split('/');
let file = parts.slice(0, parts.length - 1).join('/');
return renderFile(file + '/' + path, data, true);
let $path = parts.join('/')
.split('\\')
.join('//')
.split('//')
.slice(0, -1)
.join('\\');
return renderFile($path + path?.replace(/\.\//g, '\\')?.replace(/\.\.\//g, '\\'), data, true);
}
})).replace('\r\n', '');
} catch(parseErr) {
} catch (parseErr) {
parseErr.name = 'Render.js Error';
const fileContent = fs.readFileSync(filePath).toString();
console.error(parseErr);
return fs.readFileSync(path.join(__dirname, './error.html')).toString()

@@ -42,0 +48,0 @@ .replace(/{{error}}/g, parseErr.name + ': ' + parseErr.message)

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