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

derby-jade

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derby-jade - npm Package Compare versions

Comparing version 0.6.4 to 0.6.6

lib/coffee.js

7

derby_adapter.js
var jade = require('./index');
var options = {};
var jadeCompiler = function(file, filename, options) {
options || (options = {});
var jadeCompiler = function(file, filename) {
var out;

@@ -13,5 +13,6 @@ jade.renderFile(filename, options, function(err, html) {

module.exports = function(app) {
module.exports = function(app, opts) {
if (opts) options = opts;
app.viewExtensions.push('.jade');
app.compilers['.jade'] = jadeCompiler;
};

@@ -7,2 +7,3 @@ /*!

var coffee = require('./coffee');
var utils = require('./utils');

@@ -24,3 +25,5 @@

options = options || {};
this.coffee = options.coffee;
this.input = str.replace(/\r\n|\r/g, '\n');
if (this.coffee) this.input = coffee.compileInput(this.input);
this.colons = options.colons;

@@ -431,2 +434,4 @@ this.deferredTokens = [];

, js = captures[2];
if (this.coffee) js = coffee.compile(js);
// Quickfix for single quotes - replace all occurances of ' with "

@@ -571,2 +576,3 @@ js = js.replace(/'/g, '"');

tok.escaped[key] = escapedAttr;
if (this.coffee && coffee.isEvent(key)) val = coffee.compileAttr(val);
tok.attrs[key] = '' == val

@@ -573,0 +579,0 @@ ? true

{
"name": "derby-jade",
"description": "Jade for Derby.js",
"version": "0.6.4",
"version": "0.6.6",
"author": {

@@ -11,6 +11,6 @@ "name": "Pavel Zhukov",

"type": "git",
"url": "git://github.com/cray0000/derby-jade.git"
"url": "git://github.com/derbyparty/derby-jade.git"
},
"bugs": {
"url": "git://github.com/cray0000/derby-jade/issues"
"url": "git://github.com/derbyparty/derby-jade/issues"
},

@@ -25,6 +25,6 @@ "main": "./derby_adapter.js",

"mkdirp": "0.3.x",
"transformers": "~1.8.0"
"transformers": "~1.8.0",
"coffee-script": "~1.7.1"
},
"devDependencies": {
"coffee-script": "*",
"mocha": "*",

@@ -31,0 +31,0 @@ "markdown": "*",

@@ -19,2 +19,17 @@ # Jade static compiler for Derby.js

## Coffeescript
If you want to use Coffeescript instead of Javascript in templates:
```js
// Add Jade compilation support
app.serverUse(module, 'derby-jade', {coffee: true});
```
Then you can do something like this:
```html
if a and b
p
a(on-click="console.log c or 'log'") {{d or 'Click Me'}}
```
## Derby.js-specific syntax

@@ -21,0 +36,0 @@

Sorry, the diff of this file is not supported yet

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