🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

emblem2hbs

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emblem2hbs - npm Package Compare versions

Comparing version
2.0.0
to
2.1.0
+2
-3
.travis.yml
language: node_js
sudo: false
node_js:
- "4.1"
- "4.0"
- "5"
- "4"
- "0.12"
- "0.11"
- "0.10"
- "iojs"
script: npm test
+29
-2

@@ -10,6 +10,11 @@ #!/usr/bin/env node

if (process.argv.length < 3) {
console.log('USAGE: emblem2hbs filetoconvert.emblem')
if (process.stdin.isTTY) {
console.log('USAGE: `emblem2hbs filetoconvert.emblem [destinationFilename]` or in piped format `pbcopy | emblem2hbs | pbpaste`');
}
else {
processFromPipe();
}
} else {
emblemFile = process.argv[2];
hbsFile = emblemFile.substr(0, emblemFile.lastIndexOf('.')) + '.hbs';
hbsFile = process.argv[3] ? process.argv[3] : emblemFile.substr(0, emblemFile.lastIndexOf('.')) + '.hbs';
buf = fs.readFileSync(emblemFile, 'utf8');

@@ -19,1 +24,23 @@ output = require('emblem').default.compile(buf);

}
function processFromPipe() {
var input = process.stdin;
var output = process.stdout;
var error = null;
var data = '';
input.setEncoding('utf8');
input.on('data', function(chunk){
data += chunk;
});
input.on('end', function(){
var converted = require('emblem').default.compile(data);
output.end(indentation.indent(converted));
});
output.on('error', function(err) {
error = err;
});
}

@@ -0,1 +1,5 @@

## Version 2.1.0 - September 7, 2016
* Ability to use more easily through command-line pipes (thanks @maschwenk!)
## Version 2.0.0 - October 31, 2015

@@ -2,0 +6,0 @@

@@ -0,1 +1,2 @@

# coffeelint: disable=max_line_length
_ = require("underscore")

@@ -32,3 +33,3 @@

unless !isElse && (((isOpening || isSelfClosed) && prevTagIsSelfClosed) || (prevTagIsClosed && !isClosing) || prevTagIsOpening && isClosing && (prevTag == currentTag))
indent += (if isOpening then 1 else -1)
indent += (if isOpening then 1 else -1)
prevTag = currentTag

@@ -43,2 +44,2 @@ prevTagIsOpening = isOpening

module.exports = Indentation
module.exports = Indentation
{
"name": "emblem2hbs",
"description": "Convert emblem templates to Handlebars",
"version": "2.0.0",
"version": "2.1.0",
"bin": {

@@ -19,2 +19,3 @@ "emblem2hbs": "bin/emblem2hbs.js"

},
"license": "MIT",
"engines": {

@@ -24,14 +25,16 @@ "node": ">=0.10.0"

"dependencies": {
"coffee-script": "1.8.0",
"emblem": "~0.6.1",
"underscore": "1.7.0"
"coffee-script": "~1.10.0",
"emblem": "~0.7.0",
"underscore": "~1.8.0"
},
"devDependencies": {
"mocha": "*",
"chai": "*"
"chai": "*",
"coffeelint": "*",
"mocha": "*"
},
"scripts": {
"test": "./node_modules/.bin/mocha --compilers coffee:coffee-script/register"
"test": "mocha --compilers coffee:coffee-script/register",
"lint": "coffeelint ./lib/* || true"
},
"optionalDependencies": {}
}

@@ -1,6 +0,6 @@

emblem2hbs
==========
# emblem2hbs
[![NPM version](http://img.shields.io/npm/v/emblem2hbs.svg?style=flat)](https://www.npmjs.org/package/emblem2hbs)
[![Build Status](http://img.shields.io/travis/patientslikeme/emblem2hbs.svg?style=flat)](https://travis-ci.org/patientslikeme/emblem2hbs)
[![Dependency Status](http://img.shields.io/david/patientslikeme/emblem2hbs.svg?style=flat)](https://david-dm.org/patientslikeme/emblem2hbs)
[![Downloads](http://img.shields.io/npm/dm/emblem2hbs.svg?style=flat)](https://www.npmjs.org/package/emblem2hbs)

@@ -15,10 +15,8 @@

Credits
=======
## Credits
Created by Jonathan Slate. Additional work by Thijs de Vries, Nat Budin Morgan Wigmanich, and Xavier Cambar.
Created by Jonathan Slate. Additional work by Thijs de Vries, Nat Budin, Morgan Wigmanich, and Xavier Cambar.
License
=======
## License
emblem2hbs is released under the terms and conditions of the MIT license. See the LICENSE file for details.

@@ -14,2 +14,2 @@ chai = require("chai")

assert.equal(Indentation.indent(emblem.default.compile(input)), expected)
assert.equal(Indentation.indent(emblem.default.compile(input)), expected)

@@ -21,3 +21,3 @@ chai = require("chai")

assert.equal(Indentation.indent(unindented), indented)
it 'should correctly indent Handlebars', ->

@@ -35,3 +35,3 @@ unindented = "<div class=\"heading\" {{bind-attr disabled=model.disabled}}>{{#if conditional}}<h1>Hello world</h1>{{/if}}</div>"

assert.equal(Indentation.indent(unindented), indented)
it 'should correctly indent Handlebars with triple-staches', ->

@@ -44,2 +44,2 @@ unindented = "<div class=\"heading\" {{bind-attr disabled=model.disabled}}>{{{value}}}</div>"

"""
assert.equal(Indentation.indent(unindented), indented)
assert.equal(Indentation.indent(unindented), indented)