{"id":18808575,"url":"https://github.com/just1and0/object-to-array-convert","last_synced_at":"2025-04-13T20:21:45.937Z","repository":{"id":57312790,"uuid":"165435166","full_name":"just1and0/object-to-array-convert","owner":"just1and0","description":"🏠ℹ️ This package making it very easy to convert object to array and manipulate it","archived":false,"fork":false,"pushed_at":"2020-05-28T20:42:57.000Z","size":27,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T03:45:09.613Z","etag":null,"topics":["converter","javascript","object-to-array","reactjs","reactnative","vuejs"],"latest_commit_sha":null,"homepage":"https://just1and0.github.io/object-to-array-convert/","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/just1and0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["just1and0"],"patreon":"just1and0","ko_fi":"just1and0"}},"created_at":"2019-01-12T20:55:45.000Z","updated_at":"2024-01-31T00:57:31.000Z","dependencies_parsed_at":"2022-09-20T23:02:43.848Z","dependency_job_id":null,"html_url":"https://github.com/just1and0/object-to-array-convert","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1and0%2Fobject-to-array-convert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1and0%2Fobject-to-array-convert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1and0%2Fobject-to-array-convert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/just1and0%2Fobject-to-array-convert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/just1and0","download_url":"https://codeload.github.com/just1and0/object-to-array-convert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248776209,"owners_count":21159742,"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":["converter","javascript","object-to-array","reactjs","reactnative","vuejs"],"created_at":"2024-11-07T23:13:23.462Z","updated_at":"2025-04-13T20:21:45.906Z","avatar_url":"https://github.com/just1and0.png","language":"JavaScript","funding_links":["https://github.com/sponsors/just1and0","https://patreon.com/just1and0","https://ko-fi.com/just1and0"],"categories":[],"sub_categories":[],"readme":"# Object-To-Array-Convert\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n\n[![Build Status](https://travis-ci.com/just1and0/object-to-array-convert.svg?branch=master)](https://travis-ci.com/just1and0/object-to-array-convert/)\n\n[![Code Quality](https://scrutinizer-ci.com/g/just1and0/object-to-array-convert/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/just1and0/object-to-array-convert/?branch=master) \n\n[![NPM](https://nodei.co/npm/object-to-array-convert.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/object-to-array-convert/)\n\nThis package helps you work with objects in your project, making it very easy to convert object to array and manipulate it\n\n### Installation\n\nAdd Object-To-Array-Convert to your project by executing\n\n```sh\n$  npm install object-to-array-convert\nor\n$ yarn add object-to-array-convert\n```\n\u003e and that's it, you're all good to go!\n \n \n### Usage\n\n##### To convert object to array use the \"O2A\"\n\n```sh\n//import the O2A into your project\nimport firebase from  \"firebase\";\nimport { O2A } from 'object-to-array-convert';\n\n//and then use like so \n   firebase.database().ref(\"/user/\").on('value', (data) =\u003e {\n        const value = O2A(data);\n        return value;\n    })\n\n```\n###### NOTE: The O2A() api will add a new field to your record called object_key, which is the key of that item in the array.\n#\n\n##### To Reverse the items in an array use the \"ReverseO2A\"\n###### understand that the \"ReverseO2A\" will only reverse items in an array and nothing more. But can also be used with the \"O2A\".\n\n```sh\n//import the O2A into your project\nimport firebase from  \"firebase\";\nimport { O2A, ReverseO2A } from 'object-to-array-convert';\n\n//and then use like so \n   firebase.database().ref(\"/user/\").on('value', (data) =\u003e {\n        const value = ReverseO2A(O2A(data));\n        return value;\n    })\n\n```\n#\n\n\n##### To Get the First items in an array use the \"FirstO2A\"\n###### understand that the \"FirstO2A\" will only get the first items in an array and nothing more. But can also be used with the \"O2A\".\n\n```sh\n//import the O2A into your project\nimport firebase from  \"firebase\";\nimport { O2A, FirstO2A } from 'object-to-array-convert';\n\n//and then use like so \n   firebase.database().ref(\"/user/\").on('value', (data) =\u003e {\n        const value = FirstO2A(O2A(data));\n        return value;\n    })\n\n```\n#\n\n##### To Get the Last items in an array use the \"LastO2A\"\n###### understand that the \"LastO2A\" will only get the last items in an array and nothing more. But can also be used with the \"O2A\".\n\n```sh\n//import the O2A into your project\nimport firebase from  \"firebase\";\nimport { O2A, LastO2A } from 'object-to-array-convert';\n\n//and then use like so \n   firebase.database().ref(\"/user/\").on('value', (data) =\u003e {\n        const value = LastO2A(O2A(data));\n        return value;\n    })\n\n```\n#\n##### To Get a specific number of item in an array use the \"GetNO2A\"\n###### understand that the \"GetNO2A\" will only get the specific number of items in an array and nothing more. But can also be used with the \"O2A\".\n\n```sh\n//import the O2A into your project\nimport firebase from  \"firebase\";\nimport { O2A, GetNO2A } from 'object-to-array-convert';\n\n//and then use like so \n   firebase.database().ref(\"/user/\").on('value', (data) =\u003e {\n        const value = GetNO2A(O2A(data), 3);\n        return value;\n    })\n\n```\n\n#\n##### To Find out the total number of items in the array \"CountO2A\"\n###### understand that the \"CountO2A\" will only get the total number of items in an array and nothing more. But can also be used with the \"O2A\". \n\n```sh\n//import the O2A into your project\nimport firebase from  \"firebase\";\nimport { O2A, CountO2A } from 'object-to-array-convert';\n\n//and then use like so \n   firebase.database().ref(\"/user/\").on('value', (data) =\u003e {\n        const value = CountO2A(O2A(data));\n        return value;\n    })\n\n```\n\n\n## Props\n\n#### all Object-To-Array-Convert props\n\n| Name | Use |\n| ------ | ------ |\n| O2A(data) | to convert object to array |\n| ReverseO2A(data) | Reverse the item in an array |\n| FirstO2A(data) | Get first item in an array|\n| LastO2A(data) | Get last item in an array |\n| GetNO2A(data, number) | Get n amount of items in an array |\n| CountO2A(data) | Get total amount of items in an array |\n \n#\n\n### don't forget to star, like and share :)\n\n\n## Contributions\nWhat to help make this package even more awesome?  [Read how to contribute](https://github.com/just1and0/object-to-array-convert/blob/master/contribution.md) \n\n  \n## Licensing\nThis project is licensed under MIT license.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://linksnest.com/just1and0\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/17249207?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eOluwatobi Shokunbi \u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/just1and0/object-to-array-convert/commits?author=just1and0\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/just1and0/object-to-array-convert/commits?author=just1and0\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust1and0%2Fobject-to-array-convert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjust1and0%2Fobject-to-array-convert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjust1and0%2Fobject-to-array-convert/lists"}