{"name":"object-treeify","type":"module","version":"3.1.0","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","coveralls":"node ./node_modules/coveralls/bin/coveralls.js < ./coverage/lcov.info","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.18.6","@babel/eslint-parser":"7.18.2","@babel/register":"7.18.6","@blackflux/eslint-plugin-rules":"2.1.0","@blackflux/robo-config-plugin":"7.9.4","@vercel/ncc":"0.34.0","c8":"7.11.3","chai":"4.3.6","coveralls":"3.1.1","eslint":"8.19.0","eslint-config-airbnb-base":"15.0.0","eslint-plugin-import":"2.26.0","eslint-plugin-json":"3.1.0","eslint-plugin-markdown":"2.2.1","eslint-plugin-mocha":"10.0.5","js-gardener":"3.0.5","smart-fs":"3.0.1","treeify":"1.1.0"},"licenses":[{"type":"MIT","url":"https://github.com/blackflux/object-treeify/blob/master/LICENSE"}],"engines":{"node":">= 12"},"dependencies":{},"gitHead":"99ae30275cdd78912797ad03e87b55c5dc109ac3","_id":"object-treeify@3.1.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-kL6JHUgpTlM5rEhw8EhLFYMXtdB03TDrt5oIouJzU8ywYPVoAIkdjwe1Wx34HYhCXWQymKquimLjQ7SnaY0y9w==","shasum":"0bbc155bbee4f3ac2ffa0ef8a63852e242bc2e1e","tarball":"http://registry-npm.ywwl.com/object-treeify/download/object-treeify-3.1.0.tgz","fileCount":6,"unpackedSize":12117,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtEa2AqucvGFygLe29koTg7HskxVCuivBAadG28YXBqAiEA/1x8jy9/dUbqBBFvMDmalbzcj7xDGubkxh9es5bBRgg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0KmsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+CQ/+M18kBgZ6M9hYXtwYVS9Z/7mdIDTbGCVmawwIABfxxBhVCyvL\r\n9o78fKVABt9w8v3FLmcBgQT31zsu6j1BetnW8/InoRgKT6zqLp9eNerTCAY7\r\n2uHh5LV7H9Ku0hBeP4dxehwqUAQ2hXvtfwAgmuBRogIju5Q7JlHG53PtowkB\r\n89NPFfsNHSEBzOrzb7gm0fx2VH8qzrD3JYDW8I+iOi5SY/8PLzYtpe3repyX\r\nLi4YjQKOV24PP/KWIkFQbMZ5xFw+Bk0yafbXIds32QhGCWOjNganzN2XYreZ\r\ngr+4zW7PGuePiX7Rl3zoZ/eDta9Ds+di2xp/j7+KX0UxpgkP7lW9dPWLIeH4\r\nluyiVy8luC3cwcySKSqoIWoazwykqvvOFezftezy02juVhTe69amLH4f9AGk\r\nc4ejsfPsuOg7SqB/L1+wDGR1lWqIPUtWmVECLouwzu0IDeaj9/nmltrW8N5i\r\nqZFZ0X7JDQ26BzoBiMKnSJoJKt3gdngZvfqs50Qf5ZLHpat67qdZiKHZ+Ee7\r\nhzSQr6PumV4LLHo4ElFEdrG3AEJe4BnkBEXqK5dtm70UDU2cc+uADviPT4PL\r\nLKLv7YjsM+A56h/qTMTnYId9LvEAmuYawzB4RHJJ5DAuZMQwvw869R3CoqSo\r\neQRKKK2a5JTyZMoQ6055RIMEd/u1wFG5Nj8=\r\n=Yr8B\r\n-----END PGP SIGNATURE-----\r\n","size":4649,"noattachment":false,"key":"/object-treeify/-/object-treeify-3.1.0.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_3.1.0_1657842092602_0.41428099092905213"},"_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":1657842092843,"_cnpm_publish_time":1657842092843,"dist-tags":{"latest":"5.0.1"}}