Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chokidar

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chokidar - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

3

CHANGELOG.md

@@ -0,1 +1,4 @@

# Chokidar 0.5.2 (January 13, 2012)
* Removed postinstall script to prevent various npm bugs.
# Chokidar 0.5.1 (January 6, 2012)

@@ -2,0 +5,0 @@ * When starting to watch non-existing paths, chokidar will no longer throw

26

package.json
{
"name": "chokidar",
"description": "A neat wrapper around node.js fs.watch / fs.watchFile.",
"version": "0.5.1",
"keywords": ["fs", "watch", "watchFile", "watcher", "file"],
"version": "0.5.2",
"keywords": [
"fs",
"watch",
"watchFile",
"watcher",
"file"
],
"homepage": "https://github.com/paulmillr/chokidar",

@@ -15,13 +21,15 @@ "author": "Paul Miller (http://paulmillr.com)",

},
"licenses": [{
"type": "MIT",
"url": "http://github.com/paulmillr/chokidar/raw/master/README.md"
}],
"licenses": [
{
"type": "MIT",
"url": "http://github.com/paulmillr/chokidar/raw/master/README.md"
}
],
"main": "./lib/index",
"engines": {
"node": "~0.6.10 || 0.7 || 0.8"
"node": "~0.6.10 || 0.7 || 0.8 || 0.9"
},
"scripts": {
"prepublish": "coffee -o lib/ src/",
"postinstall": "node setup.js postinstall",
"prepublish": "node setup.js prepublish",
"postpublish": "node setup.js postpublish",
"test": "node setup.js test"

@@ -28,0 +36,0 @@ },

@@ -5,3 +5,3 @@ var exec = require('child_process').exec;

// Cross-platform npm postinstall & test script.
// Cross-platform node.js postinstall & test script for coffeescript projects.

@@ -12,5 +12,8 @@ var mode = process.argv[2];

var execute = function(pathParts, params, callback) {
var getBinaryPath = function(binary) {
return sysPath.join('node_modules', '.bin', binary);
};
var execute = function(path, params, callback) {
if (callback == null) callback = function() {};
var path = sysPath.join.apply(null, pathParts);
var command = 'node ' + path + ' ' + params;

@@ -24,10 +27,43 @@ console.log('Executing', command);

if (mode === 'postinstall') {
fsExists(sysPath.join(__dirname, 'lib'), function(exists) {
if (exists) return;
execute(['node_modules', 'coffee-script', 'bin', 'coffee'], '-o lib/ src/');
});
} else if (mode === 'test') {
execute(['node_modules', 'mocha', 'bin', 'mocha'],
'--compilers coffee:coffee-script --require test/common.js --colors');
var togglePostinstall = function(add) {
var pkg = require('./package.json');
if (add) {
if (!pkg.scripts) pkg.scripts = {};
pkg.scripts.postinstall = 'node setup.js test';
} else if (pkg.scripts && pkg.scripts.postinstall) {
delete pkg.scripts.postinstall;
}
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
};
switch (mode) {
// Remove `.postinstall` script to prevent stupid npm bugs.
case 'prepublish':
togglePostinstall(false);
execute(getBinaryPath('coffee'), '-o lib/ src/');
break;
// Bring back `.postinstall` script.
case 'postpublish':
console.log(sysPath.resolve(__dirname));
togglePostinstall(true);
break;
// Compile coffeescript for git users.
case 'postinstall':
fsExists(sysPath.join(__dirname, 'lib'), function(exists) {
if (exists) return;
execute(getBinaryPath('coffee'), '-o lib/ src/');
});
break;
// Run tests.
case 'test':
execute(
getBinaryPath('mocha'),
'--compilers coffee:coffee-script --require test/common.js --colors'
);
break;
}
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