{"name":"object-treeify","type":"module","version":"4.0.1","description":"Stringify Object as tree structure","main":"lib/index.js","scripts":{"clean":"rm -rf lib","build":"cp -rf ./src ./lib && ncc build -m -o lib && mv lib/index.js lib/index.min.js && cp src/index.js lib/index.js && rm lib/package.json","build-clean":"yarn run clean && yarn run build","test-simple":"c8 mocha --experimental-loader=./test/hot.js \"./test/**/*.spec.js\"","test":"yarn run clean && yarn run gardener && yarn run test-simple","semantic-release":"yarn run build-clean && npx semantic-release","gardener":"node gardener.js","docker":"docker run --net host -u`id -u`:`id -g` -v $(pwd):/user/project -v ~/.aws:/user/.aws -v ~/.npmrc:/user/.npmrc -w /user/project -it --entrypoint /bin/bash","t":"yarn test","ts":"yarn run test-simple","tsv":"yarn run test-simple --verbose","u":"yarn upgrade --latest --force","i":"yarn install --frozen-lockfile","it":"yarn run i && yarn run t","ncc-analyze":"yarn clean && cp -rf ./src ./lib && ncc build -m -s -o lib && npx source-map-explorer lib/index.js --only-mapped --html source.html && yarn clean"},"repository":{"type":"git","url":"git+https://github.com/blackflux/object-treeify.git"},"keywords":["object","tree","print","console","pretty","treeify","stringify","visualize","convert","string","debug"],"author":{"name":"Lukas Siemon"},"license":"MIT","bugs":{"url":"https://github.com/blackflux/object-treeify/issues"},"homepage":"https://github.com/blackflux/object-treeify#readme","devDependencies":{"@babel/core":"7.22.9","@babel/eslint-parser":"7.22.9","@babel/register":"7.22.5","@blackflux/eslint-plugin-rules":"3.0.0","@blackflux/robo-config-plugin":"9.1.9","@vercel/ncc":"0.36.1","c8":"8.0.1","chai":"4.3.7","eslint":"8.46.0","eslint-config-airbnb-base":"15.0.0","eslint-plugin-import":"2.28.0","eslint-plugin-json":"3.1.0","eslint-plugin-markdown":"3.0.1","eslint-plugin-mocha":"10.1.0","js-gardener":"5.0.1","smart-fs":"4.0.0","treeify":"1.1.0"},"licenses":[{"type":"MIT","url":"https://github.com/blackflux/object-treeify/blob/master/LICENSE"}],"engines":{"node":">= 16"},"dependencies":{},"gitHead":"404f75b029f82ad6617d31958ae7dafc7474337d","_id":"object-treeify@4.0.1","_nodeVersion":"16.20.1","_npmVersion":"8.19.4","dist":{"integrity":"sha512-Y6tg5rHfsefSkfKujv2SwHulInROy/rCL5F4w0QOWxut8AnxYxf0YmNhTh95Zfyxpsudo66uqkux0ACFnyMSgQ==","shasum":"f91a7dec795d8275886e7f1bd78408f6975be825","tarball":"http://registry-npm.ywwl.com/object-treeify/download/object-treeify-4.0.1.tgz","fileCount":6,"unpackedSize":12402,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6VEVRt4r/TfRMuZ32MSK0Yomw0/YtF/ohOpMYMeiCJAiANq8zjV8L/pkhUxbYdoQaO49NOg+tNFlbpaVgoiTUZIg=="}],"size":4668,"noattachment":false,"key":"/object-treeify/-/object-treeify-4.0.1.tgz"},"_npmUser":{"name":"simlu","email":"npm@blackflux.com"},"directories":{},"maintainers":[{"name":"simlu","email":"npm@blackflux.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/object-treeify_4.0.1_1691203957945_0.45349624735566896"},"_hasShrinkwrap":false,"readme":"# object-treeify\n\n[![Build Status](https://circleci.com/gh/blackflux/object-treeify.png?style=shield)](https://circleci.com/gh/blackflux/object-treeify)\n[![NPM](https://img.shields.io/npm/v/object-treeify.svg)](https://www.npmjs.com/package/object-treeify)\n[![Downloads](https://img.shields.io/npm/dt/object-treeify.svg)](https://www.npmjs.com/package/object-treeify)\n\nStringify Object as tree structure\n\n```\n{\n    oranges: {\n        'mandarin': {                                          ├─ oranges\n            clementine: null,                                  │  └─ mandarin\n            tangerine: 'so cheap and juicy!'        -=>        │     ├─ clementine\n        }                                                      │     └─ tangerine: so cheap and juicy!\n    },                                                         └─ apples\n    apples: {                                                     ├─ gala\n        'gala': null,                                             └─ pink lady\n        'pink lady': null\n    }\n}\n```\n\nProject was inspired by [treeify](https://github.com/notatestuser/treeify) and works almost identical. However\nthe algorithm is much shorter and faster, works without recursion and is very memory efficient. Furthermore\nthe output can be sorted using a custom comparator function.\n\n## Install\n\n    $ npm install --save object-treeify\n\n## Usage\n\n<!-- eslint-disable import/no-unresolved,import/no-extraneous-dependencies -->\n```js\nconst treeify = require('object-treeify');\n\ntreeify({\n  oranges: {\n    mandarin: {\n      clementine: null,\n      tangerine: 'so cheap and juicy!'\n    }\n  },\n  apples: {\n    gala: null,\n    'pink lady': null\n  }\n}, {/* options */});\n\n// =>\n// ├─ oranges\n// │  └─ mandarin\n// │     ├─ clementine\n// │     └─ tangerine: so cheap and juicy!\n// └─ apples\n//    ├─ gala\n//    └─ pink lady\n```\n\n### Features\n\n- Allows for custom sorting\n- Very fast and memory efficient implementation\n- Input traversed exactly once\n- Dependency free and small in size\n- Tests to verify correctness\n- Handles circular references\n\n## Options\n\n### joined\n\nType: `boolean`<br>\nDefault: `true`\n\nBy default a single string is returned. Can be set to `false` to instead return an array containing lines.\n\n#### spacerNoNeighbour\n\nType: `string`<br>\nDefault: `   `\n\nPrefix for depth level when no further neighbour is present.\n\n#### spacerNeighbour\n\nType: `string`<br>\nDefault: `│  `\n\nPrefix for depth level when a further neighbour is present.\n\n#### keyNoNeighbour\n\nType: `string`<br>\nDefault: `└─ `\n\nPrefix for key when no further neighbour is present.\n\n#### keyNeighbour\n\nType: `string`<br>\nDefault: `├─ `\n\nPrefix for key when a further neighbour is present.\n\n#### separator\n\nType: `string`<br>\nDefault: `: `\n\nUsed to separate node key from node value.\n\n#### renderFn\n\nType: `function`<br>\nDefault: `(node) => (['boolean', 'string', 'number'].includes(typeof node) ? node : undefined)`\n\nCan be used to overwrite the node rendering logic. Node is rendered if result is not equal `undefined`.\n\n#### sortFn\n\nType: `function`<br>\nDefault: `null`\n\nFunction that defines the key sort order. Defaults to ordering of `Object.keys(...)`, which is typically insertion order.\n\n#### breakCircularWith\n\nType: `string` or `null`<br>\nDefault: ` (circular ref.)`\n\nWhen `string`, circular references are broken with that string, at a minor performance cost.\n\n## Examples\n\nMore examples can be found in the tests.\n","publish_time":1691203958105,"_cnpm_publish_time":1691203958105,"dist-tags":{"latest":"5.0.1"}}