PHPackages                             robloach/require-one - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. robloach/require-one

ActiveComponent[Utility &amp; Helpers](/categories/utility)

robloach/require-one
====================

Loads the first package found in the given array.

1.0.3(9y ago)213[2 issues](https://github.com/RobLoach/require-one/issues)MITJavaScript

Since Jun 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/RobLoach/require-one)[ Packagist](https://packagist.org/packages/robloach/require-one)[ RSS](/packages/robloach-require-one/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

Require One [![NPM version](https://camo.githubusercontent.com/4043451c273feede0c119877c2b761cb28fb916123a45b165aa399a3539d8124/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f726571756972652d6f6e652e737667)](https://npmjs.org/package/require-one "View this project on NPM")
============================================================================================================================================================================================================================================================================================

[](#require-one-)

[![Build Status](https://camo.githubusercontent.com/c57c35c74eecbcf9ac86841305d80590d7d72982caf3d7746c68e068055204fe/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f526f624c6f6163682f726571756972652d6f6e652f6d61737465722e737667)](http://travis-ci.org/RobLoach/require-one "Check this project's build status on TravisCI")[![NPM downloads](https://camo.githubusercontent.com/abb7e996730968eacf2fa58d583ea4e9b2e1a55b4e83592cb6f9982148f1fc3d/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f726571756972652d6f6e652e737667)](https://npmjs.org/package/require-one "View this project on NPM")[![Dependency Status](https://camo.githubusercontent.com/0d2a79ce1613a37bf9287e0701760fa34d7b914a24778994db0866f2310eab21/68747470733a2f2f696d672e736869656c64732e696f2f64617669642f526f624c6f6163682f726571756972652d6f6e652e737667)](https://david-dm.org/RobLoach/require-one)

> Load the first package found from the given array.

Install
-------

[](#install)

MethodInstallation[npm](http://npmjs.com/package/jquery-once)`npm install require-one --save`[component](https://github.com/componentjs/component)`component install robloach/require-one`[Composer](https://packagist.org/packages/robloach/require-one)`composer require require-one`[Bower](http://bower.io/search/?q=require-one)`bower install require-one`Usage
-----

[](#usage)

This 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.

### CommonJS

[](#commonjs)

This 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).

```
var $ = requireOne('jquery', 'zepto', 'cheerio');
// => jQuery, Zepto or Cheerio, depending on which one is available.
```

### AMD

[](#amd)

This 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).

```
require(['require-one'], function(requireOne) {

  // Retrieve the first package that is available.
  var $ = requireOne('jquery', 'zepto', 'cheerio');
  // => jQuery, Zepto or Cheerio, depending on which one is available.

  // ...
});
```

### Globals

[](#globals)

This 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.

```
>

      var $ = requireOne('jquery', 'jQuery', 'zepto', 'Zepto', 'cheerio');
      // => jQuery, Zepto or Cheerio, depending on which one is available.

    My Sample Project

```

License
-------

[](#license)

[MIT](LICENSE.md)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~110 days

Recently: every ~135 days

Total

6

Last Release

3432d ago

Major Versions

0.2.0 → 1.0.02015-07-09

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25086?v=4)[Rob Loach](/maintainers/RobLoach)[@RobLoach](https://github.com/RobLoach)

---

Top Contributors

[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (33 commits)")

### Embed Badge

![Health badge](/badges/robloach-require-one/health.svg)

```
[![Health](https://phpackages.com/badges/robloach-require-one/health.svg)](https://phpackages.com/packages/robloach-require-one)
```

###  Alternatives

[eftec/autoloadone

AutoloadOne is a program that generates an autoload class for PHP.

403.4k](/packages/eftec-autoloadone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
