How to use the shellwords.escape function in shellwords

To help you get started, we’ve selected a few shellwords examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alan-ai / alan-sdk-reactnative / testtools / node_modules / node-notifier / lib / utils.js View on Github external
module.exports.command = function(notifier, options, cb) {
  notifier = shellwords.escape(notifier);
  if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
    console.info('node-notifier debug info (command):');
    console.info('[notifier path]', notifier);
    console.info('[notifier options]', options.join(' '));
  }

  return cp.exec(notifier + ' ' + options.join(' '), function(
    error,
    stdout,
    stderr
  ) {
    if (error) return cb(error);
    cb(stderr, stdout);
  });
};
github lintopher0315 / Quick-Math / node_modules / node-notifier / lib / utils.js View on Github external
module.exports.command = function(notifier, options, cb) {
  notifier = shellwords.escape(notifier);
  if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
    console.info('node-notifier debug info (command):');
    console.info('[notifier path]', notifier);
    console.info('[notifier options]', options.join(' '));
  }

  return cp.exec(notifier + ' ' + options.join(' '), function(
    error,
    stdout,
    stderr
  ) {
    if (error) return cb(error);
    cb(stderr, stdout);
  });
};
github mikaelbr / node-notifier / lib / utils.js View on Github external
module.exports.command = function(notifier, options, cb) {
  notifier = shellwords.escape(notifier);
  if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
    console.info('node-notifier debug info (command):');
    console.info('[notifier path]', notifier);
    console.info('[notifier options]', options.join(' '));
  }

  return cp.exec(notifier + ' ' + options.join(' '), function(
    error,
    stdout,
    stderr
  ) {
    if (error) return cb(error);
    cb(stderr, stdout);
  });
};
github makuga01 / dnsFookup / FE / node_modules / node-notifier / lib / utils.js View on Github external
module.exports.command = function(notifier, options, cb) {
  notifier = shellwords.escape(notifier);
  if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
    console.info('node-notifier debug info (command):');
    console.info('[notifier path]', notifier);
    console.info('[notifier options]', options.join(' '));
  }

  return cp.exec(notifier + ' ' + options.join(' '), function(
    error,
    stdout,
    stderr
  ) {
    if (error) return cb(error);
    cb(stderr, stdout);
  });
};
github mathiasbynens / grunt-zopfli / tasks / zopfli.js View on Github external
var zopfli = function(filePath, destPath, options, callback) {

		var args = [
			'-c',
			'--i' + options.iterations,
			options.format == 'gzip' ? '--gzip'
				: options.format == 'deflate' ? '--deflate'
					: '--zlib',
			shellEscape(filePath)
		];
		var bin = options.path || 'zopfli';

		if (options.splitLast) {
			args.unshift('--splitlast');
		};

		var command = bin + ' ' + args.join(' ') + ' > ' + shellEscape(destPath);
		exec(command, function(error, stdout, stderr) {
			callback.call(this, error || stderr, stdout);
		});
	};
github mathiasbynens / grunt-zopfli / tasks / zopfli.js View on Github external
var args = [
			'-c',
			'--i' + options.iterations,
			options.format == 'gzip' ? '--gzip'
				: options.format == 'deflate' ? '--deflate'
					: '--zlib',
			shellEscape(filePath)
		];
		var bin = options.path || 'zopfli';

		if (options.splitLast) {
			args.unshift('--splitlast');
		};

		var command = bin + ' ' + args.join(' ') + ' > ' + shellEscape(destPath);
		exec(command, function(error, stdout, stderr) {
			callback.call(this, error || stderr, stdout);
		});
	};

shellwords

Manipulate strings according to the word parsing rules of the UNIX Bourne shell.

MIT
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis

Popular shellwords functions