Updates node_modules
DISABLE_THIRD_PARTY_CHECK=Package needs updating with node_modules
Change-Id: I889f1b86c586e37307a3e13ad762aa56d1ece150
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1946468
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
diff --git a/node_modules/treeify/examples/fs_tree.js b/node_modules/treeify/examples/fs_tree.js
new file mode 100755
index 0000000..d1076ab
--- /dev/null
+++ b/node_modules/treeify/examples/fs_tree.js
@@ -0,0 +1,45 @@
+#!/usr/bin/env node
+
+(function(){
+
+ try {
+ var dive = require('dive');
+ } catch (ex) {
+ console.error('this example requires "dive", please run "npm install dive"');
+ process.exit(1);
+ }
+
+ var treeify = require('../treeify'),
+ path = require('path'),
+ fs = require('fs'),
+ rootDir = process.argv.length < 3 ? '.' : process.argv[2],
+ tree = {};
+
+ if ( ! fs.existsSync(rootDir)) {
+ console.error('path "' + rootDir + '" does not exist - unable to proceed!');
+ process.exit(1);
+ }
+
+ console.log(rootDir !== '.' ? path.relative(process.cwd(), rootDir) : '.');
+
+ function scanComplete() {
+ process.stdout.write('\r \r');
+ console.log(treeify.asTree(tree, true));
+ }
+
+ dive(rootDir, { all: true, directories: true }, function(err, thisPath) {
+ var relativePath = path.relative(rootDir, thisPath),
+ node = tree;
+
+ if (relativePath.indexOf('..') !== 0) {
+ relativePath.split(path.sep).forEach(function(part) {
+ typeof node[part] !== 'object' && (node[part] = {});
+ node = node[part];
+ });
+ }
+
+ }, scanComplete);
+
+ process.stdout.write('wait... ');
+
+})();