{"name":"fast-archy","version":"1.1.0","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts","default":"./dist/index.cjs"},"./*":"./*"},"scripts":{"test":"vitest run","bench":"tsx --expose-gc --allow-natives-syntax src/index.bench.ts","build":"rollup -c"},"keywords":["hierarchy","npm ls","unicode","pretty","print"],"sideEffects":false,"author":{"name":"D-Sketon"},"license":"MIT","description":"render nested hierarchies `npm ls` style with unicode pipes","devDependencies":{"@rollup/plugin-terser":"^1.0.0","@rollup/plugin-typescript":"^12.3.0","archy":"^1.0.0","mitata":"^1.0.34","rollup":"^4.62.2","tslib":"^2.8.1","tsx":"^4.23.1","typescript":"^5.9.3","vitest":"^4.1.10"},"publishConfig":{"provenance":true,"access":"public"},"repository":{"type":"git","url":"git+https://github.com/D-Sketon/fast-archy.git"},"bugs":{"url":"https://github.com/D-Sketon/fast-archy/issues"},"homepage":"https://github.com/D-Sketon/fast-archy#readme","gitHead":"2c2fdf96d1223b1dfb249c2c39db6c4cc0113d25","_id":"fast-archy@1.1.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-CECNuPvHraaAhtvyEj73We9z/sd+IjNvsnxdqvASSGoG6vdb1phgFw+YnP0VFcv47/jUEIH7Pt51vpldr6sM3A==","shasum":"ce2bcc2657bfcc38d22e95790c647fd9dc3c7597","tarball":"http://registry-npm.ywwl.com/fast-archy/download/fast-archy-1.1.0.tgz","fileCount":6,"unpackedSize":7456,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/fast-archy@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCwN3CR5X/afPMUhH8DyuYGMImW1taROA4cI7cuDx640AIhAKtHg74oSLrmTdLEQtxT5lxWldGqJxx5nuAsQvOEhlli"}],"size":3233,"noattachment":false,"key":"/fast-archy/-/fast-archy-1.1.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0a2a4a16-c491-4d24-9c9a-e2e70a4b7b28"}},"directories":{},"maintainers":[{"name":"d-sketon","email":"2055272094@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-archy_1.1.0_1785058958591_0.5436896978839016"},"_hasShrinkwrap":false,"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":1785058958739,"_cnpm_publish_time":1785058958739,"dist-tags":{"latest":"1.1.1"}}