compose-new
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -18,7 +18,9 @@ var Transform = require('stream').Transform | ||
util.inherits(ComposeNew, Transform); | ||
function ComposeNew(dataJSONFilePath, options) { | ||
function ComposeNew(data, filePath, options) { | ||
options = options || {}; | ||
this.buffer = new Buffer(INCLUDES.join('\n')) | ||
var dataFile = dataJSONFilePath || '/public/data.json'; | ||
this.dataJSONFilePath = path.join(process.cwd(), dataFile); | ||
this.data = data; | ||
this.filePath = filePath || process.cwd(); | ||
var dataFile = '/public/data.json'; | ||
this.dataJSONFilePath = path.join(this.filePath, dataFile); | ||
Transform.call(this, options); | ||
@@ -38,8 +40,7 @@ } | ||
, basedir: '/' | ||
, filename: process.cwd() + '/src/foo' | ||
, filename: self.filePath + '/src/foo' | ||
, data: {} | ||
} | ||
, stylesheetUrl = process.cwd() + '/public/styles/screen.css' | ||
, stylesheetUrl = self.filePath + '/public/styles/screen.css' | ||
; | ||
var handleCssInline = function(err, result) { | ||
@@ -55,3 +56,2 @@ if (err) | ||
return done(err); | ||
fs.readFile(stylesheetUrl, function(err, screenCss) { | ||
@@ -69,2 +69,7 @@ if (err) | ||
}; | ||
if (self.data) { | ||
jadeOptions.data = self.data; | ||
return jade.render(source, jadeOptions, handleJadeRender); | ||
} | ||
fs.readFile(this.dataJSONFilePath, function(err, data) { | ||
@@ -71,0 +76,0 @@ // `err` no 'data.json', that's okay. its not required. |
{ | ||
"name": "compose-new", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Command line tools for rapid email development", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7866
179
1