{"id":16186912,"url":"https://github.com/robloach/require-one","last_synced_at":"2025-03-19T03:30:33.255Z","repository":{"id":32950719,"uuid":"36547174","full_name":"RobLoach/require-one","owner":"RobLoach","description":":fishing_pole_and_fish: Require the first found module from an array.","archived":false,"fork":false,"pushed_at":"2023-01-11T06:48:04.000Z","size":20,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-28T14:04:42.522Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npm.im/require-one","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/RobLoach.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-30T06:54:09.000Z","updated_at":"2023-01-11T06:48:08.000Z","dependencies_parsed_at":"2023-01-14T22:48:05.809Z","dependency_job_id":null,"html_url":"https://github.com/RobLoach/require-one","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Frequire-one","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Frequire-one/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Frequire-one/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Frequire-one/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/require-one/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243963585,"owners_count":20375644,"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-10T07:19:49.366Z","updated_at":"2025-03-19T03:30:32.912Z","avatar_url":"https://github.com/RobLoach.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Require One [![NPM version](https://img.shields.io/npm/v/require-one.svg)](https://npmjs.org/package/require-one \"View this project on NPM\")\n\n[![Build Status](https://img.shields.io/travis/RobLoach/require-one/master.svg)](http://travis-ci.org/RobLoach/require-one \"Check this project's build status on TravisCI\")\n[![NPM downloads](https://img.shields.io/npm/dm/require-one.svg)](https://npmjs.org/package/require-one \"View this project on NPM\")\n[![Dependency Status](https://img.shields.io/david/RobLoach/require-one.svg)](https://david-dm.org/RobLoach/require-one)\n\n\u003e Load the first package found from the given array.\n\n## Install\n\nMethod | Installation\n------ | ------------\n[npm](http://npmjs.com/package/jquery-once) | `npm install require-one --save`\n[component](https://github.com/componentjs/component) | `component install robloach/require-one`\n[Composer](https://packagist.org/packages/robloach/require-one) | `composer require require-one`\n[Bower](http://bower.io/search/?q=require-one) | `bower install require-one`\n\n## Usage\n\nThis works across [CommonJS](https://webpack.github.io/docs/commonjs.html)/[node](http://nodejs.org), [AMD](http://requirejs.org/docs/whyamd.html#amd) and with global variables for the browser.\n\n### CommonJS\n\nThis is an example of loading either [jQuery](http://jquery.com), [Zepto](http://zeptojs.com), or [Cheerio](http://cheeriojs.github.io/cheerio) with a CommonJS module loader, like [Node.js](http://nodejs.org).\n\n``` javascript\nvar $ = requireOne('jquery', 'zepto', 'cheerio');\n// =\u003e jQuery, Zepto or Cheerio, depending on which one is available.\n```\n\n### AMD\n\nThis is an example of loading either [jQuery](http://jquery.com), [Zepto](http://zeptojs.com), or [Cheerio](http://cheeriojs.github.io/cheerio) with an AMD module loader, like [Require.js](http://requirejs.org).\n\n``` javascript\nrequire(['require-one'], function(requireOne) {\n\n  // Retrieve the first package that is available.\n  var $ = requireOne('jquery', 'zepto', 'cheerio');\n  // =\u003e jQuery, Zepto or Cheerio, depending on which one is available.\n\n  // ...\n});\n```\n\n### Globals\n\nThis is an example of loading either [jQuery](http://jquery.com), [Zepto](http://zeptojs.com), or [Cheerio](http://cheeriojs.github.io/cheerio) without a module loader, i.e. with the browser's global variables.\n\n``` html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"text/javascript\" src=\"path/to/require-one.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      var $ = requireOne('jquery', 'jQuery', 'zepto', 'Zepto', 'cheerio');\n      // =\u003e jQuery, Zepto or Cheerio, depending on which one is available.\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1\u003eMy Sample Project\u003c/h1\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Frequire-one","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobloach%2Frequire-one","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Frequire-one/lists"}