{"_id":"@agarimo/archy","name":"@agarimo/archy","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@agarimo/archy","version":"1.0.0","description":"Render nested hierarchies with unicode pipes","main":"src/index.js","scripts":{"test":"eslint --fix . && jest --silent --coverage --maxWorkers=4 ."},"repository":{"type":"git","url":"git+https://github.com/agarimojs/archy.git"},"author":{"name":"Jesus Seijas","email":"jseijas@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/agarimojs/archy/issues"},"homepage":"https://github.com/agarimojs/archy#readme","devDependencies":{"@agarimo/bench":"^1.0.0","eslint":"^8.12.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.26.0","eslint-plugin-jest":"^26.1.3","eslint-plugin-prettier":"^4.0.0","jest":"^27.5.1","prettier":"^2.6.2"},"publishConfig":{"access":"public"},"gitHead":"fa48a11b0cda9b6bcddfcc137832d6609e539e9a","_id":"@agarimo/archy@1.0.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-fvbXOtirD5uiruFZcxFieYF8jVSg2Obx/M0bMuD6RgRO7EfuRLTp5AAXoY8Kgg+szjaNG1a8ec4Wcq75qYgyQQ==","shasum":"164affdc3e0ccda524abaad8900172740af42aa9","tarball":"https://registry.npmjs.org/@agarimo/archy/-/archy-1.0.0.tgz","fileCount":9,"unpackedSize":8926,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBx4ihoTEYIXe4EAjH0Ft1aalA7vvxA/sUjB6yMCtdw4AiEAj4oktOuVer9ZsLNBWcukA0w9OFVQaQvv8MTqsuUOkPQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifegOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7uw/+LCsUPL4HGDndQ82tzed1ItQuBrKq/HwWkIohXs0GaTHM8zYA\r\nH36Na3m2snzGiv0Ziznf2Rcx0v8FvcUvv13DzPplyJodT9sKdOGr/eEqY1mS\r\nEF8jFUWOpZUy+wYE3gEJd7ONmoZr7SoiyzkxvGwcja4lZ/WLUvaxfaJdZ9gb\r\nEeIuka781wBOOI/jqEUDVEw/eSxf7BPDbuNLhN3u5W9lshtPb3fNi4kcnDBb\r\nOzy2RfmIkqCaccukCTRzaWFrnOiSArVJBff+FEgxZBmMThlEVmf48KB/ruFn\r\nmh1avmmVZkd67zDPKChXgvC5vFaszKAS/eMIj49DM1hprWGQh+oeoEdLBsHB\r\nnMMWb/FVfMyeclUP/SkyPB4D50MqwZ8jAFMz05yn7WcwMDhCaoc4q/rXYIDb\r\nCd3/koipEzijZ06zAAVVLKnE1e1wELNoaC9sZoavA/Obfe/8BWNHihbUiZhV\r\nJTW4sjeLtA74skyPXAZIxh48zGslmiQ152WsOcpz0XXn56w41ys9J4ImywXi\r\nccqYmigiJICfwl3XfuEGkzek66Ay1CPCWhRJYTLapCg+0O3MTivhhb/fhRYG\r\nLaoch8MQvYwSvQIA6ZulWWGIy1XylTmGv5g98FAMtzt9mBNaz8G3/A0FpYn6\r\nTpcI4hUcL9aoHKzPVfOjJT6fyKMTnqybHlc=\r\n=RVek\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jesus-seijas","email":"jseijas@gmail.com"},"directories":{},"maintainers":[{"name":"jesus-seijas","email":"jseijas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/archy_1.0.0_1652418574193_0.09998072676789005"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-13T05:09:34.149Z","1.0.0":"2022-05-13T05:09:34.319Z","modified":"2022-05-13T05:09:34.481Z"},"maintainers":[{"name":"jesus-seijas","email":"jseijas@gmail.com"}],"description":"Render nested hierarchies with unicode pipes","homepage":"https://github.com/agarimojs/archy#readme","repository":{"type":"git","url":"git+https://github.com/agarimojs/archy.git"},"author":{"name":"Jesus Seijas","email":"jseijas@gmail.com"},"bugs":{"url":"https://github.com/agarimojs/archy/issues"},"license":"MIT","readme":"# @agarimo/archy\n\nRender nested hierarchies `npm ls` style with unicode pipes.\nBased on https://github.com/substack/node-archy\n\n## Installation\n\n```sh\nnpm install @agarimo/archy\n```\n\n## API: archy(obj, prefix='', opts={})\n\nReturn a string representation of `obj` with unicode pipe characters like how\n`npm ls` looks.\n\n`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. \nThese names `'label'` and `'nodes'` are the default ones but can be changed using opts.\n\nIf a node is a string, that string will be used as the `'label'` and an empty array of `'nodes'` will be used.\n\n`prefix` gets prepended to all the lines and is used by the algorithm to recursively update.\n\nIf `'label'` has newlines they will be indented at the present indentation level with the current prefix.\n\nTo disable unicode results in favor of all-ansi output set `opts.unicode` to `false`.\nTo change the `'label'` field set `opts.labelField` to the new value.\nTo change the `'nodes'` field set `opts.nodesField` to the new value.\n\n## example\n\n```javascript\nconst archy = require('@agarimo/archy');\nconst result = archy({\n  label : 'beep',\n  nodes : [\n    'ity',\n    {\n      label : 'boop',\n      nodes : [\n        {\n          label : 'o_O',\n          nodes : [\n            {\n              label : 'oh',\n              nodes : [ 'hello', 'puny' ]\n            },\n            'human'\n          ]\n        },\n        'party\\ntime!'\n      ]\n    }\n  ]\n});\nconsole.log(result);\n```\n\nOutput:\n\n```\nbeep\n├── ity\n└─┬ boop\n  ├─┬ o_O\n  │ ├─┬ oh\n  │ │ ├── hello\n  │ │ └── puny\n  │ └── human\n  └── party\n      time!\n```\n\n## example changing the label and nodes fields to name and children.\n\n```javascript\nconst archy = require('@agarimo/archy');\nconst result = archy({\n  name : 'beep',\n  children : [\n    'ity',\n    {\n      name : 'boop',\n      children : [\n        {\n          name : 'o_O',\n          nodes : [\n            {\n              name : 'oh',\n              children : [ 'hello', 'puny' ]\n            },\n            'human'\n          ]\n        },\n        'party\\ntime!'\n      ]\n    }\n  ]\n},\nundefined,\n{\n  labelField: 'name',\n  nodesField: 'children'\n});\n\nconsole.log(result);\n```\n\nOutput:\n\n```\nbeep\n├── ity\n└─┬ boop\n  ├─┬ o_O\n  │ ├─┬ oh\n  │ │ ├── hello\n  │ │ └── puny\n  │ └── human\n  └── party\n      time!\n```\n\n\n# license\n\nMIT","readmeFilename":"README.md"}