compose-new
Advanced tools
Comparing version 0.0.1 to 0.0.2
60
index.js
@@ -1,39 +0,33 @@ | ||
var jade = require('jade') | ||
, INCLUDES = [ | ||
'include ' + require('jade-email-doc').filepath | ||
, 'include ' + require('jade-email-body').filepath | ||
, 'include ' + require('jade-email-section').filepath | ||
, 'include ' + require('jade-bulletproof-button').filepath | ||
, '' // leave last index empty for final `\n` | ||
] | ||
, options = { | ||
pretty: true | ||
, basedir: '/' | ||
} | ||
, buffer = new Buffer(INCLUDES.join('\n')) | ||
var ComposeNew = require('./lib/compose-new') | ||
, server = require('./lib/server') | ||
, mkdir = require('./lib/mkdir') | ||
, build = require('./lib/build') | ||
, program = require('commander') | ||
, package = require('./package.json') | ||
; | ||
var mkdir = function mkdir() { | ||
console.error('directory mgmt not yet implemented!'); | ||
} | ||
if (require.main !== module) | ||
return module.exports = ComposeNew; | ||
var render = function render() { | ||
var init = function init() { | ||
var source = buffer.toString(); | ||
process.stdout.write(jade.render(source, options)); | ||
}; | ||
program | ||
.version(package.version) | ||
.option('-s, --server', 'start the server') | ||
.option('-d, --data [string]', 'specific data.json file for rendering, defaults to public/data.json') | ||
.option('-c, --create', 'create new `dev` directory at cwd') | ||
.option('-b, --build', 'build all `jade` files in /src dir and place into /build') | ||
.parse(process.argv) | ||
; | ||
process.stdin | ||
.on('readable', function() { | ||
while (chunk = this.read()) | ||
buffer = Buffer.concat([buffer, chunk]); | ||
}) | ||
.on('finish', init) | ||
; | ||
} | ||
if (program.server) | ||
return server.init(program.data); | ||
if (process.argv[2]) | ||
mkdir(); | ||
else | ||
render(); | ||
if (program.create) | ||
return mkdir.init(); | ||
if (program.build) | ||
return build.init(program.data); | ||
process.stdin | ||
.pipe(new ComposeNew(program.data)) | ||
.pipe(process.stdout) | ||
; |
{ | ||
"name": "compose-new", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Command line tools for rapid email development", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
], | ||
"bin" : "./index.js", | ||
"bin": "./index.js", | ||
"bugs": { | ||
@@ -28,4 +28,6 @@ "url": "https://github.com/tbuchok/compose-new/issues" | ||
"dependencies": { | ||
"jade": "~1.1.5" | ||
"jade": "~1.1.5", | ||
"juice": "~0.4.0", | ||
"commander": "~2.1.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7705
10
173
3
4
2
+ Addedcommander@~2.1.0
+ Addedjuice@~0.4.0
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbatch@0.3.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcommander@1.1.1(transitive)
+ Addedcontextify@0.1.15(transitive)
+ Addedcookiejar@1.3.0(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcssom@0.2.50.3.8(transitive)
+ Addedcssstyle@0.2.37(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@0.7.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddom-serializer@0.2.2(transitive)
+ Addeddomelementtype@1.3.12.3.0(transitive)
+ Addeddomhandler@2.4.2(transitive)
+ Addeddomutils@1.7.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedemitter-component@1.0.0(transitive)
+ Addedentities@1.1.22.2.0(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedformidable@1.0.9(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhtmlparser2@3.10.1(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjsdom@0.6.5(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedjuice@0.4.0(transitive)
+ Addedkeypress@0.1.0(transitive)
+ Addedmethods@0.0.1(transitive)
+ Addedmime@1.2.5(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addednan@2.22.0(transitive)
+ Addednwmatcher@1.3.9(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@0.6.56.5.3(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedslick@1.10.4(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedsuperagent@0.14.9(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)