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

templatizer

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

templatizer - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

0

jaderuntime.js

@@ -0,0 +0,0 @@ 'use strict';

2

lib/simplifyTemplate.js

@@ -34,3 +34,3 @@ var esprima = require('esprima');

// check for single string push
if (i === 3 && node.type === "ExpressionStatement" && node.expression.callee.object.name === "buf" &&
if (i === 3 && node.type === "ExpressionStatement" && node.expression.callee && node.expression.callee.object.name === "buf" &&
node.expression.arguments.length === 1 && node.expression.arguments[0].type === "Literal") {

@@ -37,0 +37,0 @@ // save the simple string

{
"name": "templatizer",
"description": "Simple solution for compiling jade templates into vanilla JS functions for blazin' fast client-side use.",
"version": "1.0.1",
"version": "1.1.0",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -22,3 +22,3 @@ "bin": "./bin/cli",

"falafel": "^0.3.1",
"jade": "^1.5.0",
"jade": "^1.7.0",
"minimist": "^0.1.0",

@@ -35,4 +35,4 @@ "uglify-js": "^2.4.0",

"phantomjs": "^1.9.7-15",
"precommit-hook": "^0.4.1",
"testee": "0.0.13",
"precommit-hook": "^1.0.7",
"testee": "^0.1.1",
"yetify": "0.1.0"

@@ -39,0 +39,0 @@ },

@@ -84,2 +84,6 @@ # templatizer.js

#### `dontRemoveMixins` (boolean, default false)
By default `jade` will not compile any mixins which aren't being called from the file they were created in. This is usually a very good thing, since keeps file sizes down. But in some cases (especially when using the [mixin support](#mixin-support) functionality), you may want to create mixins and call them from other places in your code or other files. Setting this option to `true` will keep all mixins in the compiled source.
#### `jade` (object, default `{}`)

@@ -86,0 +90,0 @@

@@ -8,2 +8,3 @@ var jade = require('jade');

var path = require('path');
var util = require('util');
var _ = require('underscore');

@@ -15,2 +16,9 @@ var fs = require('fs');

// Setting dynamicMixins to true will result in
// all mixins being written to the file
function DynamicMixinsCompiler () {
jade.Compiler.apply(this, arguments);
this.dynamicMixins = true;
}
util.inherits(DynamicMixinsCompiler, jade.Compiler);

@@ -24,2 +32,3 @@ module.exports = function (templateDirectories, outputFile, options) {

dontTransformMixins: false,
dontRemoveMixins: false,
jade: {},

@@ -110,2 +119,6 @@ namespace: '' // No namespace means 'window'

if (options.dontRemoveMixins) {
jadeCompileOptions.compiler = DynamicMixinsCompiler;
}
jadeCompileOptions.filename = item;

@@ -112,0 +125,0 @@ var template = beautify(jade.compileClient(fs.readFileSync(item, 'utf-8'), jadeCompileOptions).toString());

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