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

brjade

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brjade - npm Package Compare versions

Comparing version 0.0.1 to 0.0.3

42

index.js

@@ -6,4 +6,5 @@ 'use strict';

var staticModule = require('static-module');
var quote = require('quote-stream');
var resolve = require('resolve');
var assign = require('object-assign');
var stringify = require('js-stringify');
var jade = require('jade');

@@ -20,13 +21,8 @@

var vars = {
var vars = assign({
__filename: file,
__dirname: path.dirname(file),
require: { resolve: resolver }
};
}, opts.vars);
if (opts.vars)
Object.keys(opts.vars).forEach(function( key ){
vars[key] = opts.vars[key];
});
var sm = staticModule({

@@ -42,25 +38,31 @@ jade: {

function resolver(p){
return resolve.sync(p, { basedir: path.dirname(file) });
return sm;
function resolver( p ){
return resolve.sync(p, {
basedir: path.dirname(file),
});
}
return sm;
function renderFile( file, opts ){
var markup = quote();
var render = jade.compileFile(file, opts);
markup.end(jade.renderFile(file, opts));
track(sm, [ file ].concat(render.dependencies));
sm.emit('file', file);
return markup;
return stringify(render(opts));
}
function render( source, opts ){
var markup = quote();
var render = jade.compile(source, opts);
markup.end(jade.render(source, opts));
track(sm, render.dependencies);
return markup;
return stringify(render(opts));
}
};
function track( sm, files ){
files.forEach(function( file ){
sm.emit('file', file);
});
}
{
"name": "brjade",
"version": "0.0.1",
"version": "0.0.3",
"description": "Turn jade.render and jade.renderFile calls into inlined markup",

@@ -11,6 +11,7 @@ "repository": {

"static-module": "^1.1.2",
"quote-stream": "^0.0.0",
"resolve": "^1.1.6",
"jade": "^1.9.2",
"through2": "^0.6.3"
"through2": "^0.6.3",
"object-assign": "^2.0.0",
"js-stringify": "^1.0.0"
},

@@ -17,0 +18,0 @@ "keywords": [

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