{"name":"fast-archy","version":"1.0.0","keywords":["hierarchy","npm ls","unicode","pretty","print"],"author":{"name":"D-Sketon"},"license":"MIT","_id":"fast-archy@1.0.0","maintainers":[{"name":"d-sketon","email":"2055272094@qq.com"}],"homepage":"https://github.com/D-Sketon/fast-archy#readme","bugs":{"url":"https://github.com/D-Sketon/fast-archy/issues"},"dist":{"shasum":"26c8850718de3cecb15200e9257c09f1ad2fa0d0","tarball":"http://registry-npm.ywwl.com/fast-archy/download/fast-archy-1.0.0.tgz","fileCount":6,"integrity":"sha512-j8CNf0sCX92BogtUZAMPhMj7p3nv7xxeETwfpVWQNQocC5b21FAa6bUzfuhcNoEa4f2RtDe5U3uY0NriH9nA7g==","signatures":[{"sig":"MEYCIQDuP/Ch1V2jc9jQS99N9gycKllGYRuxbGiNXmV7kamxjwIhAI7sAL5lppq1RHENOtVpzkqm0yx+p3CBkxtTiqVH0cMt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8419,"size":3544,"noattachment":false,"key":"/fast-archy/-/fast-archy-1.0.0.tgz"},"main":"dist/index.cjs","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.cjs","require":"./dist/index.cjs"},"./*":"./*"},"gitHead":"099abe279839583b101e3f048c6a8f85803ef5b3","scripts":{"test":"vitest run","bench":"tsx --expose-gc --allow-natives-syntax src/index.bench.ts","build":"rollup -c"},"_npmUser":{"name":"d-sketon","email":"2055272094@qq.com"},"repository":{"url":"git+https://github.com/D-Sketon/fast-archy.git","type":"git"},"_npmVersion":"10.5.2","description":"render nested hierarchies `npm ls` style with unicode pipes","directories":{},"sideEffects":false,"_nodeVersion":"20.13.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","archy":"^1.0.0","tslib":"^2.8.1","mitata":"^1.0.34","rollup":"^4.50.0","vitest":"^3.2.4","typescript":"^5.9.2","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^12.1.4"},"_npmOperationalInternal":{"tmp":"tmp/fast-archy_1.0.0_1757142636237_0.7020993253433856","host":"s3://npm-registry-packages-npm-production"},"readme":"# fast-archy\n\n![npm bundle size](https://img.shields.io/bundlephobia/min/fast-archy) ![npm](https://img.shields.io/npm/v/fast-archy) ![NPM](https://img.shields.io/npm/l/fast-archy)\n\nRender nested hierarchies `npm ls` style with unicode pipes.\n\nRewrite of [archy](https://www.npmjs.com/package/archy) in TypeScript, making it faster.\n\n## Install\n\n```sh\nnpm install fast-archy\n```\n\n## Usage\n\n```js\nimport archy from \"fast-archy\";\n\nconst s = archy({\n  label: \"beep\\none\\ntwo\",\n  nodes: [\n    \"ity\",\n    {\n      label: \"boop\",\n      nodes: [\n        {\n          label: \"o_O\\nwheee\",\n          nodes: [\n            {\n              label: \"oh\",\n              nodes: [\"hello\", \"puny\\nmeat\"],\n            },\n            \"creature\",\n          ],\n        },\n        \"party\\ntime!\",\n      ],\n    },\n  ],\n});\n\nconsole.log(s);\n```\n\nOutput:\n\n```\nbeep\n│ one\n│ two\n├── ity\n└─┬ boop\n  ├─┬ o_O\n  │ │ wheee\n  │ ├─┬ oh\n  │ │ ├── hello\n  │ │ └── puny\n  │ │     meat\n  │ └── creature\n  └── party\n      time!\n```\n\n## API\n\n### archy(obj, prefix?, opts?)\n\n- `obj` `object|string` - Tree object or string label.\n  - `obj.label` `string` - Node label.\n  - `obj.nodes` `array` - Array of child nodes (same structure as `obj`).\n- `prefix` `string` - Custom prefix for tree branches (default: `\"\"`).\n- `opts` `object` - Options object.\n  - `opts.unicode` `boolean` - Use Unicode characters (default: `true`). If `false`, uses ASCII characters.\n\n## Benchmarks\n\n```\nclk: ~3.91 GHz\ncpu: 13th Gen Intel(R) Core(TM) i5-13400F\nruntime: node 26.5.0 (x64-win32)\n\nbenchmark                   avg (min … max) p75 / p99    (min … top 1%)\n------------------------------------------- -------------------------------\n• archy - simple tree\n------------------------------------------- -------------------------------\nfast-archy                   113.96 ns/iter 116.77 ns 147.29 ns ▄██▅▃▃▂▁▁▁▁\narchy                        458.72 ns/iter 452.59 ns 733.96 ns █▇▂▂▁▁▁▁▁▁▁\n\nsummary\n  fast-archy\n   4.03x faster than archy\n\n• archy - medium tree\n------------------------------------------- -------------------------------\nfast-archy                   465.74 ns/iter 468.70 ns 619.04 ns ▃█▅▂▁▂▁▁▁▁▁\narchy                          2.73 µs/iter   2.76 µs   3.17 µs ▂▆██▄▁▂▁▁▁▁\n\nsummary\n  fast-archy\n   5.87x faster than archy\n\n• archy - complex tree\n------------------------------------------- -------------------------------\nfast-archy                   472.15 µs/iter 476.20 µs 717.20 µs ▆█▇▂▁▁▁▁▁▁▁\narchy                          1.29 ms/iter   1.29 ms   1.68 ms ▁▃█▃▂▁▁▁▁▁▁\n\nsummary\n  fast-archy\n   2.73x faster than archy\n\n• archy - ascii mode\n------------------------------------------- -------------------------------\nfast-archy (ascii)           440.13 ns/iter 440.60 ns 693.73 ns ▄█▂▂▁▁▁▁▁▁▁\narchy (ascii)                  3.02 µs/iter   3.06 µs   3.16 µs ▁▁▃▄▃▄█▄▃▂▂\n\nsummary\n  fast-archy (ascii)\n   6.87x faster than archy (ascii)\n\n• archy - beepHexo\n------------------------------------------- -------------------------------\nfast-archy                     1.32 ms/iter   1.32 ms   2.20 ms ▇█▂▁▁▁▁▁▁▁▁\narchy                         10.07 ms/iter  10.15 ms  13.73 ms ▃█▆▂▂▁▁▁▁▁▁\n\nsummary\n  fast-archy\n   7.64x faster than archy\n```\n\n## License\n\nMIT\n","publish_time":1757142636445,"_cnpm_publish_time":1757142636445,"dist-tags":{"latest":"1.1.1"}}