{"id":17474153,"url":"https://github.com/ghostffcode/arrobj","last_synced_at":"2025-07-01T22:33:33.512Z","repository":{"id":57184274,"uuid":"73412627","full_name":"ghostffcode/arrobj","owner":"ghostffcode","description":":anchor: Arrays and Object conversion in Javascript","archived":false,"fork":false,"pushed_at":"2016-11-27T00:27:41.000Z","size":56,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T12:10:16.189Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostffcode.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":"2016-11-10T19:07:55.000Z","updated_at":"2019-07-15T22:56:46.000Z","dependencies_parsed_at":"2022-09-14T08:50:32.053Z","dependency_job_id":null,"html_url":"https://github.com/ghostffcode/arrobj","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ghostffcode/arrobj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Farrobj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Farrobj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Farrobj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Farrobj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostffcode","download_url":"https://codeload.github.com/ghostffcode/arrobj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostffcode%2Farrobj/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262589898,"owners_count":23333257,"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-18T18:08:35.450Z","updated_at":"2025-07-01T22:33:33.455Z","avatar_url":"https://github.com/ghostffcode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arrobj\n---\n## Easily modify Arrays and Objects in javascript\n\n## Installation\n- via npm:\n```bash\nnpm install arrobj\n```\n- via bower\n```bash\nbower install arrobj\n```\n\n## Usage\n- In node:\n```javascript\n// vanilla javascript\nconst arrobj = require(\"arrobj\");\n// es6 syntax\nimport * as arrobj from \"arrobj\";\n```\n\n- In browser:\n```html\n\u003cscript src=\"path/to/arrobj.js\"\u003e\u003c/script\u003e\n```\n\n### Convert Array to Object\nBelow code:\n```javascript\nvar values = ['bliss', 21, ['soccer', 'basketball']];\nvar key = ['name', 'age', 'sports'];\nconsole.log(arrobj.toObj(values, key));\n```\nWill create object:\n```javascript\n{\n  name: 'bliss',\n  age: 21,\n  sports: ['soccer', 'basketball']\n}\n```\nIf the key array is shorter than the values array, the index of the values in the array will used instead. The produced array for the above use case will be:\n```javascript\n{\n  0: 'bliss',\n  1: 21,\n  2: ['soccer', 'basketball']\n}\n```\n\n### Convert Object to Array\nTo convert an object to an array, the below case:\n```javascript\nvar obj = {\n  name: 'bliss',\n  age: 21,\n  sports: ['soccer', 'basketball']\n};\n\nconsole.log(arr.toArr(obj));\n```\nWill produce array:\n```javascript\n['bliss', 21, ['soccer', 'basketball']]\n```\n\n## Other Methods\n### Arrays\n\n* __isFlat(array)__: Checks if an array has a nested array.\n\n* __isEqual(array1, array2)__: Compares two arrays by length.\n\n* __isSame(array1, array2)__: Checks if the values in the array are the same, works for deep level comparison.\n\n* __Arr(array)__: Checks if an argument is an array.\n\n### Objects\n\n* __isObj(obj)__: Checks if argument is an object, returns true or false.\n\n\n## Contributing\n- Fork this repo.\n- clone and do you.\n- send a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostffcode%2Farrobj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostffcode%2Farrobj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostffcode%2Farrobj/lists"}