{"id":21482337,"url":"https://github.com/entwicklerstube/hashids-in-object","last_synced_at":"2025-03-17T09:21:23.230Z","repository":{"id":57148930,"uuid":"92649755","full_name":"entwicklerstube/hashids-in-object","owner":"entwicklerstube","description":"🔎 Go through object, detect id values and decode or encode them","archived":false,"fork":false,"pushed_at":"2017-07-20T08:46:16.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T05:34:54.556Z","etag":null,"topics":["decode","encode","hash","hashids","object","url"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/hashids-in-object","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/entwicklerstube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-28T08:43:24.000Z","updated_at":"2017-07-27T06:49:34.000Z","dependencies_parsed_at":"2022-08-31T20:10:22.532Z","dependency_job_id":null,"html_url":"https://github.com/entwicklerstube/hashids-in-object","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entwicklerstube%2Fhashids-in-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entwicklerstube%2Fhashids-in-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entwicklerstube%2Fhashids-in-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entwicklerstube%2Fhashids-in-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entwicklerstube","download_url":"https://codeload.github.com/entwicklerstube/hashids-in-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006290,"owners_count":20382443,"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":["decode","encode","hash","hashids","object","url"],"created_at":"2024-11-23T12:32:25.600Z","updated_at":"2025-03-17T09:21:23.210Z","avatar_url":"https://github.com/entwicklerstube.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hashids in object\n\u003e Go through object, detect id values and decode or encode them\n\n[![Build Status](https://travis-ci.org/entwicklerstube/hashids-in-object.svg?branch=master)](https://travis-ci.org/entwicklerstube/hashids-in-object)\n\n### Install\n**yarn**\n```\nyarn add hashids-in-object\n```\n\n**npm**\n```\nnpm install hashids-in-object --save\n```\n\n### Usage\n```js\nimport { encode, decode } from 'hashids-in-object'\n\n// Input\nconst example = {\n  id: 123,\n  user_id: 391,\n  name: 'Michael',\n  contact_id: 12,\n  some: {\n    deep: [{\n      object: {\n        in: {\n          array: [{\n            id: 1\n          }]\n        }\n      }\n    }]\n  }\n}\n\n// Process\nconst encodedExample = encode(example)\n\n// Output\n{\n  id: 'aMj3b',\n  user_id: 'elpJe',\n  name: 'Michael',\n  contact_id: '7ax9b',\n  some: {\n    deep: [{\n      object: {\n        in: {\n          array: [{\n            id: 'aMj3b'\n          }]\n        }\n      }\n    }]\n  }\n}\n\n// Decode it:\ndecode(encodedExample)\n\n// Output\n{\n  id: 123,\n  user_id: 391,\n  name: 'Michael',\n  contact_id: 12,\n  some: {\n    deep: [{\n      object: {\n        in: {\n          array: [{\n            id: 1\n          }]\n        }\n      }\n    }]\n  }\n}\n```\n\n\n### Under the hood\nAt the moment it uses the [`hashids.js`](https://github.com/ivanakimov/hashids.js) module to encode/decode the single id's.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentwicklerstube%2Fhashids-in-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentwicklerstube%2Fhashids-in-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentwicklerstube%2Fhashids-in-object/lists"}