New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

asparagus

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asparagus - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

hooks/pre-commit

15

index.js
'use strict';
var _Promise = require('bluebird'),
fs = _Promise.promisifyAll(require('fs')),
var Bluebird = require('bluebird'),
fs = Bluebird.promisifyAll(require('fs')),
pathUtil = require('path'),
join = pathUtil.join,
Compiler = require('./lib/compiler');
Pecan = require('pecan');

@@ -21,3 +21,2 @@ module.exports = function asparagus(src, options) {

var dest = options.dest || src,
// strip filename from base directory path
sources = {},

@@ -30,3 +29,3 @@ destinations = {};

if (isDirectory(filename)) {
return promise(filename);
return resolveWith(filename);
} else {

@@ -50,4 +49,4 @@ // if a file, compile it and return the compiler

function promise(filename) {
return new _Promise(function (resolve) {
function resolveWith(filename) {
return new Bluebird(function (resolve) {
if (Object.keys(sources).length >= 2) {

@@ -78,3 +77,3 @@ return Object.keys(sources).map(function (id) {

if (!options.exclusive || (options.exclusive && attrs.src.indexOf(options.exclusive) !== -1)) {
Compiler.create(getPaths(attrs.src, attrs.dest, attrs.filename), options).compile();
Pecan.create(getPaths(attrs.src, attrs.dest, attrs.filename), options).compile();
}

@@ -81,0 +80,0 @@ } else {

{
"name": "asparagus",
"version": "0.0.3",
"version": "0.0.4",
"description": "Flexible template compiler. Compile all or some of your templates, even those in parallel sub-folders, to a location that may or may not yet exist.",

@@ -33,2 +33,3 @@ "keywords": [

"scripts": {
"hooks": "chmod +x hooks/*; cd .git/hooks && ln -sf ../../hooks/* .",
"unit": "node ./node_modules/mocha/bin/mocha test/",

@@ -40,4 +41,4 @@ "lint": "node ./node_modules/jshint/bin/jshint ./",

"dependencies": {
"jade": "1.5.0",
"node-fs": "0.1.7"
"pecan": "0.0.1",
"bluebird": "2.3.2"
},

@@ -51,6 +52,4 @@ "devDependencies": {

"sinon": "1.10.3",
"sinon-chai": "2.5.0",
"express": "4.9.0",
"bluebird": "2.3.2"
"sinon-chai": "2.5.0"
}
}

@@ -28,3 +28,3 @@ asparagus

```
var asparagus = require('aspargus');
var asparagus = require('asparagus');

@@ -31,0 +31,0 @@ // A source parameter is required as the first argument to asparagus

'use strict';
var asparagus = require('../'),
Compiler = require('../lib/compiler');
Pecan = require('pecan');

@@ -11,3 +11,3 @@ describe('asparagus', sandbox(function () {

beforeEach(function () {
sandbox.stub(Compiler, 'create', function () {
sandbox.stub(Pecan, 'create', function () {
compiler = { compile: sandbox.stub() };

@@ -30,3 +30,3 @@ return compiler;

Compiler.create.getCall(0).should.have.been.calledWith({
Pecan.create.getCall(0).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/t1.js',

@@ -48,3 +48,3 @@ tmplPath: __dirname + '/dummySource/t1.jade'

Compiler.create.getCall(0).should.have.been.calledWith({
Pecan.create.getCall(0).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d2/sub/subtfile2.js',

@@ -66,3 +66,3 @@ tmplPath: __dirname + '/dummySource/d2/sub/subtfile2.jade'

Compiler.create.getCall(0).should.have.been.calledWith({
Pecan.create.getCall(0).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/t1.js',

@@ -72,3 +72,3 @@ tmplPath: __dirname + '/dummySource/t1.jade'

Compiler.create.getCall(1).should.have.been.calledWith({
Pecan.create.getCall(1).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/t2.js',

@@ -78,3 +78,3 @@ tmplPath: __dirname + '/dummySource/t2.jade'

Compiler.create.getCall(2).should.have.been.calledWith({
Pecan.create.getCall(2).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d1/d1.js',

@@ -84,3 +84,3 @@ tmplPath: __dirname + '/dummySource/d1/d1.jade',

Compiler.create.getCall(3).should.have.been.calledWith({
Pecan.create.getCall(3).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d2/d2.js',

@@ -90,3 +90,3 @@ tmplPath: __dirname + '/dummySource/d2/d2.jade'

Compiler.create.getCall(4).should.have.been.calledWith({
Pecan.create.getCall(4).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d1/sub/subtfile1.js',

@@ -96,3 +96,3 @@ tmplPath: __dirname + '/dummySource/d1/sub/subtfile1.jade',

Compiler.create.getCall(5).should.have.been.calledWith({
Pecan.create.getCall(5).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d2/sub/subtfile2.js',

@@ -115,3 +115,3 @@ tmplPath: __dirname + '/dummySource/d2/sub/subtfile2.jade'

Compiler.create.getCall(0).should.have.been.calledWith({
Pecan.create.getCall(0).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d1/sub/subtfile1.js',

@@ -121,3 +121,3 @@ tmplPath: __dirname + '/dummySource/d1/sub/subtfile1.jade',

Compiler.create.getCall(1).should.have.been.calledWith({
Pecan.create.getCall(1).should.have.been.calledWith({
jsPath: __dirname + '/dummySource/d2/sub/subtfile2.js',

@@ -124,0 +124,0 @@ tmplPath: __dirname + '/dummySource/d2/sub/subtfile2.jade'

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