Socket
Socket
Sign inDemoInstall

chokidar-cli

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chokidar-cli - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

index.js

@@ -36,3 +36,3 @@ #!/usr/bin/env node

.usage(
'Usage: $0 <pattern> [<pattern>...] [options]\n\n' +
'Usage: chokidar <pattern> [<pattern>...] [options]\n\n' +
'<pattern>:\n' +

@@ -44,4 +44,4 @@ 'Glob pattern to specify files to be watched.\n' +

)
.example('$0 "**/*.js" -c "npm run build-js"', 'build when any .js file changes')
.example('$0 "**/*.js" "**/*.less"', 'output changes of .js and .less files')
.example('chokidar "**/*.js" -c "npm run build-js"', 'build when any .js file changes')
.example('chokidar "**/*.js" "**/*.less"', 'output changes of .js and .less files')
.demand(1)

@@ -48,0 +48,0 @@ .option('c', {

{
"name": "chokidar-cli",
"description": "Ultra-fast cross-platform command line utility to watch file system changes.",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [

@@ -6,0 +6,0 @@ "fs",

@@ -6,3 +6,16 @@ var childProcess = require('child_process');

// Try to resolve path to shell.
// We assume that Windows provides COMSPEC env variable
// and other platforms provide SHELL env variable
var SHELL_PATH = process.env.SHELL || process.env.COMSPEC;
var EXECUTE_OPTION = process.env.COMSPEC !== undefined ? '/c' : '-c';
// XXX: Wrapping tos to a promise is a bit wrong abstraction. Maybe RX suits
// better?
function run(cmd, opts) {
if (!SHELL_PATH) {
// If we cannot resolve shell, better to just crash
throw new Error('$SHELL environment variable is not set.');
}
opts = _.merge({

@@ -22,5 +35,5 @@ pipe: true,

var child;
var parts = shellQuote.parse(cmd);
try {
child = childProcess.spawn(_.head(parts), _.tail(parts), {
child = childProcess.spawn(SHELL_PATH, [EXECUTE_OPTION, cmd], {
cwd: opts.cwd,

@@ -27,0 +40,0 @@ stdio: opts.pipe ? 'inherit' : null

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