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

browjadify-compile

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browjadify-compile - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

test/fixtures/c.jade

10

compile.js

@@ -18,4 +18,12 @@ module.exports = compile

var fn = jade[hasClientFn ? 'compileClient' : 'compile'](fs.readFileSync(filename), options)
return 'string' === typeof fn ? new Function('return ' + fn)() : fn
if ('string' === typeof fn) fn = new Function('return ' + fn)()
fn.dependencies = listDependentFiles(filename)
return fn
}
function listDependentFiles(filename) {
var parser = new jade.Parser(fs.readFileSync(filename, 'utf8'), filename)
parser.parse()
return parser.dependencies || []
}

2

package.json
{
"name": "browjadify-compile",
"version": "0.0.2",
"version": "0.1.0",
"description": "The function browjadify uses to compile jade templates for the browser",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -25,2 +25,7 @@ var compile = require('../compile')

it('should list the dependent jade files as a property on the returned function', function () {
var template = compile(__dirname + '/fixtures/c.jade')
assert.deepEqual([ __dirname + '/fixtures/d.jade' ], template.dependencies)
})
})

@@ -27,0 +32,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