summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/archy
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-04-03 15:43:32 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-04-03 15:45:57 +0200
commit71e285b94c7edaa43aa8115965cf5a36b8e0f80a (patch)
tree7d4aa9d0d5aff686b106cd5da72ba77960c4af43 /deps/node/deps/npm/node_modules/archy
parent7dadf9356b4f3f4137ce982ea5bb960283116e9a (diff)
downloadakono-71e285b94c7edaa43aa8115965cf5a36b8e0f80a.tar.gz
akono-71e285b94c7edaa43aa8115965cf5a36b8e0f80a.tar.bz2
akono-71e285b94c7edaa43aa8115965cf5a36b8e0f80a.zip
Node.js v11.13.0
Diffstat (limited to 'deps/node/deps/npm/node_modules/archy')
-rw-r--r--deps/node/deps/npm/node_modules/archy/.travis.yml4
-rw-r--r--deps/node/deps/npm/node_modules/archy/LICENSE18
-rw-r--r--deps/node/deps/npm/node_modules/archy/README.markdown88
-rw-r--r--deps/node/deps/npm/node_modules/archy/examples/beep.js24
-rw-r--r--deps/node/deps/npm/node_modules/archy/examples/multi_line.js25
-rw-r--r--deps/node/deps/npm/node_modules/archy/index.js35
-rw-r--r--deps/node/deps/npm/node_modules/archy/package.json86
-rw-r--r--deps/node/deps/npm/node_modules/archy/test/beep.js40
-rw-r--r--deps/node/deps/npm/node_modules/archy/test/multi_line.js45
-rw-r--r--deps/node/deps/npm/node_modules/archy/test/non_unicode.js40
10 files changed, 405 insertions, 0 deletions
diff --git a/deps/node/deps/npm/node_modules/archy/.travis.yml b/deps/node/deps/npm/node_modules/archy/.travis.yml
new file mode 100644
index 00000000..895dbd36
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
diff --git a/deps/node/deps/npm/node_modules/archy/LICENSE b/deps/node/deps/npm/node_modules/archy/LICENSE
new file mode 100644
index 00000000..ee27ba4b
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/node/deps/npm/node_modules/archy/README.markdown b/deps/node/deps/npm/node_modules/archy/README.markdown
new file mode 100644
index 00000000..ef7a5cf3
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/README.markdown
@@ -0,0 +1,88 @@
+# archy
+
+Render nested hierarchies `npm ls` style with unicode pipes.
+
+[![browser support](http://ci.testling.com/substack/node-archy.png)](http://ci.testling.com/substack/node-archy)
+
+[![build status](https://secure.travis-ci.org/substack/node-archy.png)](http://travis-ci.org/substack/node-archy)
+
+# example
+
+``` js
+var archy = require('archy');
+var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+});
+console.log(s);
+```
+
+output
+
+```
+beep
+├── ity
+└─┬ boop
+ ├─┬ o_O
+ │ ├─┬ oh
+ │ │ ├── hello
+ │ │ └── puny
+ │ └── human
+ └── party
+ time!
+```
+
+# methods
+
+var archy = require('archy')
+
+## archy(obj, prefix='', opts={})
+
+Return a string representation of `obj` with unicode pipe characters like how
+`npm ls` looks.
+
+`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields.
+`'label'` is a string of text to display at a node level and `'nodes'` is an
+array of the descendents of the current node.
+
+If a node is a string, that string will be used as the `'label'` and an empty
+array of `'nodes'` will be used.
+
+`prefix` gets prepended to all the lines and is used by the algorithm to
+recursively update.
+
+If `'label'` has newlines they will be indented at the present indentation level
+with the current prefix.
+
+To disable unicode results in favor of all-ansi output set `opts.unicode` to
+`false`.
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install archy
+```
+
+# license
+
+MIT
diff --git a/deps/node/deps/npm/node_modules/archy/examples/beep.js b/deps/node/deps/npm/node_modules/archy/examples/beep.js
new file mode 100644
index 00000000..9c070479
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/examples/beep.js
@@ -0,0 +1,24 @@
+var archy = require('../');
+var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+});
+console.log(s);
diff --git a/deps/node/deps/npm/node_modules/archy/examples/multi_line.js b/deps/node/deps/npm/node_modules/archy/examples/multi_line.js
new file mode 100644
index 00000000..8afdfada
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/examples/multi_line.js
@@ -0,0 +1,25 @@
+var archy = require('../');
+
+var s = archy({
+ label : 'beep\none\ntwo',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O\nwheee',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny\nmeat' ]
+ },
+ 'creature'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+});
+console.log(s);
diff --git a/deps/node/deps/npm/node_modules/archy/index.js b/deps/node/deps/npm/node_modules/archy/index.js
new file mode 100644
index 00000000..869d64e6
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/index.js
@@ -0,0 +1,35 @@
+module.exports = function archy (obj, prefix, opts) {
+ if (prefix === undefined) prefix = '';
+ if (!opts) opts = {};
+ var chr = function (s) {
+ var chars = {
+ '│' : '|',
+ '└' : '`',
+ '├' : '+',
+ '─' : '-',
+ '┬' : '-'
+ };
+ return opts.unicode === false ? chars[s] : s;
+ };
+
+ if (typeof obj === 'string') obj = { label : obj };
+
+ var nodes = obj.nodes || [];
+ var lines = (obj.label || '').split('\n');
+ var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' ';
+
+ return prefix
+ + lines.join(splitter) + '\n'
+ + nodes.map(function (node, ix) {
+ var last = ix === nodes.length - 1;
+ var more = node.nodes && node.nodes.length;
+ var prefix_ = prefix + (last ? ' ' : chr('│')) + ' ';
+
+ return prefix
+ + (last ? chr('└') : chr('├')) + chr('─')
+ + (more ? chr('┬') : chr('─')) + ' '
+ + archy(node, prefix_, opts).slice(prefix.length + 2)
+ ;
+ }).join('')
+ ;
+};
diff --git a/deps/node/deps/npm/node_modules/archy/package.json b/deps/node/deps/npm/node_modules/archy/package.json
new file mode 100644
index 00000000..b78e34e3
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/package.json
@@ -0,0 +1,86 @@
+{
+ "_args": [
+ [
+ "archy@1.0.0",
+ "/Users/rebecca/code/npm"
+ ]
+ ],
+ "_from": "archy@1.0.0",
+ "_id": "archy@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
+ "_location": "/archy",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "archy@1.0.0",
+ "name": "archy",
+ "escapedName": "archy",
+ "rawSpec": "1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "1.0.0"
+ },
+ "_requiredBy": [
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
+ "_spec": "1.0.0",
+ "_where": "/Users/rebecca/code/npm",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": {
+ "url": "https://github.com/substack/node-archy/issues"
+ },
+ "description": "render nested hierarchies `npm ls` style with unicode pipes",
+ "devDependencies": {
+ "tap": "~0.3.3",
+ "tape": "~0.1.1"
+ },
+ "homepage": "https://github.com/substack/node-archy#readme",
+ "keywords": [
+ "hierarchy",
+ "npm ls",
+ "unicode",
+ "pretty",
+ "print"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "archy",
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/substack/node-archy.git"
+ },
+ "scripts": {
+ "test": "tap test"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": {
+ "iexplore": [
+ "6.0",
+ "7.0",
+ "8.0",
+ "9.0"
+ ],
+ "chrome": [
+ "20.0"
+ ],
+ "firefox": [
+ "10.0",
+ "15.0"
+ ],
+ "safari": [
+ "5.1"
+ ],
+ "opera": [
+ "12.0"
+ ]
+ }
+ },
+ "version": "1.0.0"
+}
diff --git a/deps/node/deps/npm/node_modules/archy/test/beep.js b/deps/node/deps/npm/node_modules/archy/test/beep.js
new file mode 100644
index 00000000..4ea74f9c
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/test/beep.js
@@ -0,0 +1,40 @@
+var test = require('tape');
+var archy = require('../');
+
+test('beep', function (t) {
+ var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party!'
+ ]
+ }
+ ]
+ });
+ t.equal(s, [
+ 'beep',
+ '├── ity',
+ '└─┬ boop',
+ ' ├─┬ o_O',
+ ' │ ├─┬ oh',
+ ' │ │ ├── hello',
+ ' │ │ └── puny',
+ ' │ └── human',
+ ' └── party!',
+ ''
+ ].join('\n'));
+ t.end();
+});
diff --git a/deps/node/deps/npm/node_modules/archy/test/multi_line.js b/deps/node/deps/npm/node_modules/archy/test/multi_line.js
new file mode 100644
index 00000000..2cf2154d
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/test/multi_line.js
@@ -0,0 +1,45 @@
+var test = require('tape');
+var archy = require('../');
+
+test('multi-line', function (t) {
+ var s = archy({
+ label : 'beep\none\ntwo',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O\nwheee',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny\nmeat' ]
+ },
+ 'creature'
+ ]
+ },
+ 'party\ntime!'
+ ]
+ }
+ ]
+ });
+ t.equal(s, [
+ 'beep',
+ '│ one',
+ '│ two',
+ '├── ity',
+ '└─┬ boop',
+ ' ├─┬ o_O',
+ ' │ │ wheee',
+ ' │ ├─┬ oh',
+ ' │ │ ├── hello',
+ ' │ │ └── puny',
+ ' │ │ meat',
+ ' │ └── creature',
+ ' └── party',
+ ' time!',
+ ''
+ ].join('\n'));
+ t.end();
+});
diff --git a/deps/node/deps/npm/node_modules/archy/test/non_unicode.js b/deps/node/deps/npm/node_modules/archy/test/non_unicode.js
new file mode 100644
index 00000000..7204d332
--- /dev/null
+++ b/deps/node/deps/npm/node_modules/archy/test/non_unicode.js
@@ -0,0 +1,40 @@
+var test = require('tape');
+var archy = require('../');
+
+test('beep', function (t) {
+ var s = archy({
+ label : 'beep',
+ nodes : [
+ 'ity',
+ {
+ label : 'boop',
+ nodes : [
+ {
+ label : 'o_O',
+ nodes : [
+ {
+ label : 'oh',
+ nodes : [ 'hello', 'puny' ]
+ },
+ 'human'
+ ]
+ },
+ 'party!'
+ ]
+ }
+ ]
+ }, '', { unicode : false });
+ t.equal(s, [
+ 'beep',
+ '+-- ity',
+ '`-- boop',
+ ' +-- o_O',
+ ' | +-- oh',
+ ' | | +-- hello',
+ ' | | `-- puny',
+ ' | `-- human',
+ ' `-- party!',
+ ''
+ ].join('\n'));
+ t.end();
+});