Comparing version 0.1.4 to 0.1.5
@@ -5,3 +5,3 @@ { | ||
"description": "Watch files in a directory for changes/updates", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/kalisjoshua/sherpa", | ||
@@ -12,3 +12,5 @@ "repository": { | ||
"main": "sherpa", | ||
"dependencies": {}, | ||
"dependencies": { | ||
"expresso": ">=0.9.2" | ||
}, | ||
"devDependencies": {}, | ||
@@ -15,0 +17,0 @@ "optionalDependencies": {}, |
@@ -5,10 +5,11 @@ # Sherpa | ||
I know that this might not be the best way to do this but it seems to work for right now so I am putting it out there. Simply create a file to execte in the terminal (example below) and point it at the directory you would like to watch. When a file is changed the callback you pass in will execute and you can do whatever you want with the change. | ||
I know that this might not be the best way to do this but it seems to work for right now so I am putting it out there. Simply create a file to execute in the terminal (example below) and point it at the directory you would like to watch. When a file is changed the callback you pass in will execute and you can do whatever you want with the change. | ||
I have started using this in conjunction with Grunt.js so I don't have to grunt with each change to my files while developing. | ||
## Example file | ||
## Basic Usage | ||
#!/usr/bin/env node | ||
/*jshint strict:false*/ | ||
Create a file in the root of your project with the contents below; don't forget chmod +x <filename>. | ||
/*jshint laxcomma:true strict:false*/ | ||
/*globals require*/ | ||
@@ -19,5 +20,5 @@ var exec = require('child_process').exec | ||
function notify (filename, command) { | ||
puts(null, "\nChange made to: " + filename); | ||
sherpa.puts(null, "\nChange made to: " + filename); | ||
command && exec(command, puts); | ||
command && exec(command, sherpa.puts); | ||
} | ||
@@ -40,1 +41,5 @@ | ||
}); | ||
## Testing | ||
I have started some simple tests using expresso. To run tests simply ensure that the npm modules are installed by executing `npm install` in the root directory. Then execute `expresso` in the root. Hopefully all tests should pass. |
/*jshint laxcomma:true strict:false*/ | ||
/*globals console module require*/ | ||
var fs = require("fs") | ||
, path = require("path"); | ||
, path = require("path") | ||
, util = require("util"); | ||
function valid_args (args) { | ||
return args.length > 1 && | ||
args[0] != null && args[1] != null && | ||
typeof [].pop.call(args) === "function"; | ||
} | ||
function valid_root (val) { | ||
return val !== "" && | ||
{}.toString.call(val) === "[object String]"; | ||
} | ||
function walk (start, callback) { | ||
@@ -34,7 +46,7 @@ fs.lstat(start, function (err, stat) { | ||
module.exports = function (root, interval, callback) { | ||
if (arguments.length < 2) { | ||
if (!valid_root(root) || !valid_args(arguments)) { | ||
throw("Invalid arguments"); | ||
} | ||
if (typeof callback === "undefined" && typeof interval === "function") { | ||
if (!callback && !!interval) { | ||
callback = interval; | ||
@@ -59,1 +71,13 @@ interval = undefined; | ||
}; | ||
module.exports.puts = function puts(error, stdout, stderr) { util.puts(stdout); }; | ||
module.exports.valid = { | ||
args: function () { | ||
return valid_args.apply(null, [].slice.call(arguments, 0)); | ||
} | ||
,root: function (val) { | ||
return valid_root(val); | ||
} | ||
}; |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
6626
5
127
43
1
1
+ Addedexpresso@>=0.9.2
+ Addedexpresso@0.9.2(transitive)