{"id":18799888,"url":"https://github.com/mcnaveen/random-array-item","last_synced_at":"2026-05-18T01:02:17.763Z","repository":{"id":57159230,"uuid":"466686715","full_name":"mcnaveen/random-array-item","owner":"mcnaveen","description":"Simple utility to fetch a random item from an array","archived":false,"fork":false,"pushed_at":"2022-03-06T09:09:58.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T18:52:48.310Z","etag":null,"topics":["array","node-module","nodejs","random","random-array"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/random-array-item","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/mcnaveen.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":null,"patreon":"mcnaveen","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/mcnaveen"}},"created_at":"2022-03-06T09:06:27.000Z","updated_at":"2023-09-08T08:23:03.000Z","dependencies_parsed_at":"2022-09-07T20:12:35.837Z","dependency_job_id":null,"html_url":"https://github.com/mcnaveen/random-array-item","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Frandom-array-item","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Frandom-array-item/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Frandom-array-item/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcnaveen%2Frandom-array-item/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcnaveen","download_url":"https://codeload.github.com/mcnaveen/random-array-item/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239728857,"owners_count":19687415,"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","node-module","nodejs","random","random-array"],"created_at":"2024-11-07T22:16:58.309Z","updated_at":"2026-05-18T01:02:07.746Z","avatar_url":"https://github.com/mcnaveen.png","language":"JavaScript","funding_links":["https://patreon.com/mcnaveen","https://www.buymeacoffee.com/mcnaveen"],"categories":[],"sub_categories":[],"readme":"# Random Array Item\n\n![Build](https://github.com/mcnaveen/random-array-item/workflows/Build/badge.svg)\n![Downloads this Week](https://img.shields.io/npm/dw/random-array-item)\n![Bundle Size](https://img.shields.io/bundlephobia/min/random-array-item)\n![Version](https://img.shields.io/npm/v/random-array-item)\n\n![Numify](./images/cover.png)\n\n:unicorn: Simple utility to fetch a random item from an array.\n\n### :package: Requirements\n\nNode.js 12.x LTS or 14.x (or Higher) LTS\n\n### :sparkles: Installation\n\nInstall the NPM Package with the below command:\n\n```\nnpm install random-array-item --save\n```\n\n(or)\n\nInstall with Yarn:\n\n```\nyarn add random-array-item\n```\n\n### :pen: Usage\n\nImport the module in your project:\n\n```javascript\n// Commonjs Import\nvar { randomArrayItem } = require(\"random-array-item\");\n\n// or ES6 import\nimport { randomArrayItem } from \"random-array-item\";\n```\n\n### :bulb: Example\n\nPass the Array to the function\n\n```javascript\nimport { randomArrayItem } from \"random-array-item\";\n\nlet array = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"];\nlet randomItem = randomArrayItem(array);\nconsole.log(randomItem);\n```\n\n### :ballot_box_with_check: Example Output\n\n```\n7\n```\n\n### :shield: LICENSE\n\n- MIT\n\n---\n\n#### :green_heart: Message\n\nI hope you find this useful. If you have any questions, please create an issue.\n\n---\n\n#### 💰 Help me with your donation\n\n\u003ca href=\"https://www.buymeacoffee.com/mcnaveen\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcnaveen%2Frandom-array-item","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcnaveen%2Frandom-array-item","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcnaveen%2Frandom-array-item/lists"}