{"id":17049106,"url":"https://github.com/toddself/flatten-object","last_synced_at":"2025-06-20T16:15:06.937Z","repository":{"id":15106347,"uuid":"17833179","full_name":"toddself/flatten-object","owner":"toddself","description":"Flatten a nested object, renaming keys if collisions exist","archived":false,"fork":false,"pushed_at":"2015-04-25T22:26:34.000Z","size":144,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T16:08:55.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toddself.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-17T15:36:59.000Z","updated_at":"2019-05-30T06:09:36.000Z","dependencies_parsed_at":"2022-09-08T23:41:36.377Z","dependency_job_id":null,"html_url":"https://github.com/toddself/flatten-object","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fflatten-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fflatten-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fflatten-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Fflatten-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toddself","download_url":"https://codeload.github.com/toddself/flatten-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248594136,"owners_count":21130314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T09:53:51.973Z","updated_at":"2025-04-12T16:13:10.456Z","avatar_url":"https://github.com/toddself.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://secure.travis-ci.org/toddself/flatten-object.png)](http://travis-ci.org/toddself/flatten-object)\n\n# flatten-object\nFlattens nested javascript objects into a single level. Enumerates keys that collide.\n\n## Usage\n`npm install flatten-object`\n\n```js\n\u003e var flattenObject = require('flatten-object');\n\u003e var nested  = {foo: 'bar', baz: {foo: 'bar'}};\n\u003e flattenObject(nested):\n{\n    foo_0: 'bar',\n    foo_1: 'bar'\n};\n```\n\n```js\n\u003e var flattenObject = require('flatten-object');\n\u003e var nested  = {foo: 'bar', baz: {foo: 'bar'}};\n\u003e flattenObject(nested, 0, '-'):\n{\n    foo-0: 'bar',\n    foo-1: 'bar'\n};\n```\n\n## API\n\n### flattenObject(object, maxDepth, separator)\n\n```\n/**\n * Flatten an object down to a optionally specified maximum depth\n * @method  exports\n * @param   {object} obj Object to flatten\n * @param   {integer} [maxDepth=0] Maximum depth to recurse to. Zero is unlimited.\n * @param   {string}  [sep=_] Separator for keys. If you use this, you must specify maxDepth. It's just how javascript is\n * @returns {object} flattened object\n */\n```\n\n## License\n[MIT license](/LICENSE), Copyright © 2015 Todd Kennedy","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Fflatten-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoddself%2Fflatten-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Fflatten-object/lists"}