{"id":21829714,"url":"https://github.com/0xtlt/rocket-array","last_synced_at":"2026-05-13T05:39:42.213Z","repository":{"id":65491076,"uuid":"154458082","full_name":"0xtlt/rocket-Array","owner":"0xtlt","description":"Rocket Array is designed to be simplest way possible to manipulate your array","archived":false,"fork":false,"pushed_at":"2019-07-30T07:42:41.000Z","size":16,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T05:51:41.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/0xtlt.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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":"2018-10-24T07:32:22.000Z","updated_at":"2019-08-06T23:45:30.000Z","dependencies_parsed_at":"2023-01-25T18:45:27.925Z","dependency_job_id":null,"html_url":"https://github.com/0xtlt/rocket-Array","commit_stats":null,"previous_names":["thomast404/rocket-array"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtlt%2Frocket-Array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtlt%2Frocket-Array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtlt%2Frocket-Array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xtlt%2Frocket-Array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xtlt","download_url":"https://codeload.github.com/0xtlt/rocket-Array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244801066,"owners_count":20512587,"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-11-27T18:28:52.197Z","updated_at":"2026-05-13T05:39:41.979Z","avatar_url":"https://github.com/0xtlt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rocket Array 2.1 🎉🚀\n\nRocket Array 2.1 is 33.6% lighter and until 20 times more faster than Rocket Array 1.5 and is designed to be simplest way possible to manipulate your array\n\n## Installation 🌍\n\n    $ npm install rocket-array\n\n## How it works ?\n\nInitialize\n\n```javascript\nrequire(\"rocket-array\"); //for node.js integration\n\n//example for this doc\nconst myArray = [\n  \"this\",\n  \"is\",\n  \"hello\",\n  \"world\",\n  {\n    name: \"alice\",\n    infos: {\n      level: 18\n    }\n  },\n  {\n    name: \"bob\",\n    infos: {\n      level: 50\n    }\n  },\n  {\n    name: \"other\",\n    infos: {\n      level: 2\n    }\n  },\n  5,\n  10,\n  2,\n  \"this\",\n  \"is\",\n  \"my\",\n  \"world\"\n];\n```\n\n---\n\n## Get recurrent data from array\n\n```javascript\nconst number = 2;\nconst recurrentData = myArray.recurrent(number);\n//return [[{number: 2, name: \"this\"}, {number: 2, name: \"is\"}]]\n```\n\n| Parameter | Type   | Required | Default |\n| --------- | ------ | -------- | ------- |\n| Number    | Number | No       | 1       |\n\n---\n\n## Get data with specific type\n\n```javascript\nconst type = \"number\";\nconst onlyTypeString = myArray.only(type);\n//return [5, 10, 2];\n```\n\n| Parameter | Type   | Required | Default  |\n| --------- | ------ | -------- | -------- |\n| Type      | String | Yes      | \"string\" |\n\n---\n\n## Remove recurrents data from the array\n\n```javascript\nmyArray.removeRecurrents();\n```\n\n---\n\n## Add data to the beginning of your array\n\n```javascript\nconst data = \"me\";\nmyArray.pushBefore(data);\n```\n\n| Parameter | Type | Required | Default          |\n| --------- | ---- | -------- | ---------------- |\n| Type      | All  | Yes      | No Default Value |\n\n---\n\n## Delete data with its position in the array\n\n```javascript\nconst position = 1,\n  numberElement = 2;\n//numberElement defines how much data should be deleted after the position\nmyArray.remove(position, numberElement);\n```\n\n| Parameter     | Type   | Required | Default          |\n| ------------- | ------ | -------- | ---------------- |\n| Position      | Number | Yes      | No Default Value |\n| numberElement | Number | No       | 1                |\n\n---\n\n## Find data from the array with regex\n\n```javascript\nmyArray.find({\n  regex: /is/,\n  morethan: 5,\n  lessthan: 5,\n  equal: 10,\n  type: \"string\"\n});\n\nmyArray.findJSON({\n  regex: /as/,\n  type: \"string\",\n  morethan: 5,\n  lessthan: 5,\n  equal: 10,\n  where: \"infos.level\"\n});\n```\n\n| Parameter                    | Type   | Required | Default          |\n| ---------------------------- | ------ | -------- | ---------------- |\n| equal                        | All    | No       | undefined        |\n| regex                        | Regex  | No       | false            |\n| type                         | String | No       | false            |\n| morethan                     | Number | No       | false            |\n| lessthan                     | Number | No       | false            |\n| where (just for .findJSON()) | String | Yes      | No Default Value |\n\n---\n\n## Find and remove data\n\n```javascript\n//the \"remove\" functions do not change your Array\nmyArray = myArray.findAndRemove({\n  regex: /is/,\n  lessthan: 10,\n  morethan: 9,\n  equal: 10,\n  type: \"string\"\n});\n\n//the \"remove\" functions do not change your Array\nmyArray = myArray.findAndRemoveInJSON({\n  where: \"name\",\n  regex: /is/,\n  lessthan: 10,\n  morethan: 9,\n  type: \"string\"\n});\n```\n\n| Parameter                    | Type   | Required | Default          |\n| ---------------------------- | ------ | -------- | ---------------- |\n| equal                        | All    | No       | undefined        |\n| regex                        | Regex  | No       | false            |\n| type                         | String | No       | false            |\n| morethan                     | Number | No       | false            |\n| lessthan                     | Number | No       | false            |\n| where (just for .findJSON()) | String | Yes      | No Default Value |\n\n---\n\n## Export and import Rarray\n\n```javascript\nconst local = myArray.toString(); // toString() = JSON.stringify\n```\n\n---\n\n## Search array data with multiple parameters\n\n```javascript\nconst params = [\n  {\n    where: \"name\",\n    regex: /as/\n  },\n  {\n    where: \"infos.level\",\n    morethan: 5\n  }\n];\n\nmyArray.mufindJSON(params);\n```\n\n| Parameter | Type  | Required | Default          |\n| --------- | ----- | -------- | ---------------- |\n| Params    | Array | Yes      | No Default Value |\n\n---\n\n## Search array data with multiple parameters and delete them\n\n```javascript\nconst params = [\n  {\n    where: \"name\",\n    regex: /as/\n  },\n  {\n    where: \"infos.level\",\n    morethan: 5\n  }\n];\n\nmyArray.mufindAndRemoveInJSON(params);\n```\n\n| Parameter | Type  | Required | Default          |\n| --------- | ----- | -------- | ---------------- |\n| Params    | Array | Yes      | No Default Value |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xtlt%2Frocket-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xtlt%2Frocket-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xtlt%2Frocket-array/lists"}