Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: node_modules/vulcanize/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi/cli.js

Issue 800513006: Added vulcanize under third_party/npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: node_modules/vulcanize/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi/cli.js
diff --git a/node_modules/vulcanize/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi/cli.js b/node_modules/vulcanize/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi/cli.js
new file mode 100755
index 0000000000000000000000000000000000000000..5b9546aabf8a2ecf266dc0e7476ed1133c222a7b
--- /dev/null
+++ b/node_modules/vulcanize/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi/cli.js
@@ -0,0 +1,47 @@
+#!/usr/bin/env node
+'use strict';
+var fs = require('fs');
+var pkg = require('./package.json');
+var stripAnsi = require('./');
+var argv = process.argv.slice(2);
+var input = argv[0];
+
+function help() {
+ console.log([
+ '',
+ ' ' + pkg.description,
+ '',
+ ' Usage',
+ ' strip-ansi <input-file> > <output-file>',
+ ' cat <input-file> | strip-ansi > <output-file>',
+ '',
+ ' Example',
+ ' strip-ansi unicorn.txt > unicorn-stripped.txt'
+ ].join('\n'));
+}
+
+function init(data) {
+ process.stdout.write(stripAnsi(data));
+}
+
+if (argv.indexOf('--help') !== -1) {
+ help();
+ return;
+}
+
+if (argv.indexOf('--version') !== -1) {
+ console.log(pkg.version);
+ return;
+}
+
+if (process.stdin.isTTY) {
+ if (!input) {
+ help();
+ return;
+ }
+
+ init(fs.readFileSync(input, 'utf8'));
+} else {
+ process.stdin.setEncoding('utf8');
+ process.stdin.on('data', init);
+}

Powered by Google App Engine
This is Rietveld 408576698