{"id":19934475,"url":"https://github.com/bentzibentz/arry-array","last_synced_at":"2025-03-01T11:45:37.813Z","repository":{"id":36318909,"uuid":"223162566","full_name":"bentzibentz/arRy-array","owner":"bentzibentz","description":"Modular es6 array modification library.","archived":false,"fork":false,"pushed_at":"2023-01-27T15:00:53.000Z","size":1984,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T08:17:45.241Z","etag":null,"topics":["array","es6","javascript","modification","module"],"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/bentzibentz.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":"2019-11-21T11:51:35.000Z","updated_at":"2022-09-03T08:29:03.000Z","dependencies_parsed_at":"2023-02-15T10:16:36.347Z","dependency_job_id":null,"html_url":"https://github.com/bentzibentz/arRy-array","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/bentzibentz%2FarRy-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentzibentz%2FarRy-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentzibentz%2FarRy-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentzibentz%2FarRy-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bentzibentz","download_url":"https://codeload.github.com/bentzibentz/arRy-array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241361395,"owners_count":19950379,"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":["array","es6","javascript","modification","module"],"created_at":"2024-11-12T23:16:57.228Z","updated_at":"2025-03-01T11:45:37.794Z","avatar_url":"https://github.com/bentzibentz.png","language":"JavaScript","readme":"arRy\n=====\narRy is a modular and lightweight ES6 array library to simplify array modification operations.\n\n## Installation\n\nPull it in through npm or yarn:\n\n```bash\nnpm install arry-array\n```\n\n```bash\nyarn add arry-array\n```\n\n## Usage\n\n#### Sort items\nSort items in array by defined property.\n```javascript\nsortItems(array, property)\n```\n\n##### Example\n\n```javascript\nimport { sortItems } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\"},\n    { \"id\": 4, \"name\": \"Karla Kulunder\"},\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n    { \"id\": 2, \"name\": \"Franka Frank\" }\n]\n\nsortItems(arr, 'id');\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Franka Frank\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n    { \"id\": 4, \"name\": \"Karla Kulunder\"}\n]\n*/\n```\n\n\n#### Remove item\nRemove item from array by defined value of property.\n```javascript\nremoveItem(array, property, value)\n```\n\n##### Example\n\n```javascript\nimport { removeItem } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\"},\n    { \"id\": 2, \"name\": \"Karla Kulunder\"},\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n    { \"id\": 4, \"name\": \"Franka Frank\" }\n]\n\nremoveItem(arr, 'id', 3);\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 4, \"name\": \"Franka Frank\"  }\n]\n*/\n```\n\n#### Insert item\nInsert new item at defined array index.\n```javascript\ninsertItem(array, index, ...items)\n```\n\n##### Example\n\n```javascript\nimport { insertItem } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" }\n]\n\ninsertItem(arr, 1, {\"id\": 3, \"name\": \"Moritz Pauls\"});\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" }\n]\n*/\n```\n\n#### Get item in array by property value\nGet item from by defined property value.\n```javascript\ngetItem(array, property, value)\n```\n\n##### Example\n\n```javascript\nimport { getItem } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" }\n]\n\ngetItem(arr, 'id', 2);\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 2, \"name\": \"Karla Kulunder\" }\n]\n*/\n```\n\n#### Update item in array by property value\nUpdate item in array, find by property value.\n```javascript\nupdateItemProp(array, property, value, propertyToUpdate, data)\n```\n\n##### Example\n\n```javascript\nimport { updateItemProp } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" }\n]\n\nupdateItemProp(arr, 'id', 2, 'name', 'Martin Augustus');\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Martin Augustus\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" }\n]\n*/\n```\n\n#### Get duplicate items in array by property\nGet all duplicate items from array by property value.\n```javascript\ngetDuplicates(array, property)\n```\n\n##### Example\n\n```javascript\nimport { getDuplicates } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n    { \"id\": 2, \"name\": \"Max Meier\" },\n]\n\ngetDuplicates(arr, 'id');\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 2, \"name\": \"Max Meier\" }\n]\n*/\n```\n\n#### Remove duplicate items in array by property\nRemove all duplicate items from array by property value, except the first one.\n```javascript\nremoveDuplicate(array, property)\n```\n\n##### Example\n\n```javascript\nimport { removeDuplicate } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n    { \"id\": 2, \"name\": \"Max Meier\" },\n]\n\nremoveDuplicate(arr, 'id');\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 1, \"name\": \"Max Mustermann\" },\n    { \"id\": 2, \"name\": \"Karla Kulunder\" },\n    { \"id\": 3, \"name\": \"Moritz Pauls\" },\n]\n*/\n```\n\n#### Filter array by multiple properties\nGet all items from array by multiple property values.\n```javascript\nfilterItems(array, property)\n```\n\n##### Example\n\n```javascript\nimport { filterItems } from 'arry-array';\n\nconst arr = [\n    { \"id\": 1, \"name\":\"Mark\", \"city\": \"Mannheim\", \"age\": \"21\" },\n    { \"id\": 2, \"name\":\"Kathrin\", \"city\": \"Berlin\", \"age\": \"49\" },\n    { \"id\": 3, \"name\":\"Frank\", \"city\": \"Mannheim\", \"age\": \"21\" },\n    { \"id\": 4, \"name\":\"Max\", \"city\": \"Frankfurt\", \"age\": \"38\" },\n    { \"id\": 5, \"name\":\"Lisa\", \"city\": \"Mannheim\", \"age\": \"23\" },\n]\n\nfilterItems(arr, { city: \"Mannheim\", age: \"21\" });\n\nconsole.log(arr);\n/*\n[\n    { \"id\": 1, \"name\":\"Mark\", \"city\": \"Mannheim\", \"age\": \"21\" },\n    { \"id\": 3, \"name\":\"Frank\", \"city\": \"Mannheim\", \"age\": \"21\" },\n]\n*/\n```\n\nMore usefull functions coming soon :)\n\nCopyright (c) 2019 fabian bentz.\nReleased under the [MIT](LICENSE) license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentzibentz%2Farry-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentzibentz%2Farry-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentzibentz%2Farry-array/lists"}