require-one
Advanced tools
Comparing version 0.0.1 to 0.1.2
{ | ||
"name": "require-one", | ||
"version": "0.0.1", | ||
"version": "0.1.2", | ||
"description": "Require the first found package from an array.", | ||
@@ -5,0 +5,0 @@ "main": "require-one.js", |
# Require One | ||
[](http://travis-ci.org/RobLoach/jquery-once "Check this project's build status on TravisCI") | ||
[](https://npmjs.org/package/require-one "View this project on NPM") | ||
[](https://npmjs.org/package/require-one "View this project on NPM") | ||
[](https://david-dm.org/RobLoach/jquery-once) | ||
Load the first package found from the given array. | ||
## API | ||
## Install | ||
Method | Installation | ||
------ | ------------ | ||
[npm](http://npmjs.com/package/jquery-once) | `npm install require-one --save` | ||
[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 | ||
This works across CommonJS/Node, AMD and with global variables. | ||
@@ -37,2 +52,6 @@ | ||
<script type="text/javascript" src="../require-one.js"></script> | ||
<script> | ||
var con = requireOne(['nope', 'nopers', 'nopes', 'console']); | ||
con.log('Hello World! Found the console?'); | ||
</script> | ||
</head> | ||
@@ -42,2 +61,2 @@ <body> | ||
</body> | ||
</html> | ||
</html> |
@@ -16,3 +16,3 @@ /*! | ||
define(function(require) { | ||
// We will use AMD's require() wrapper. | ||
// Use AMD's require() wrapper. | ||
return (root.requireOne = factory(require)); | ||
@@ -19,0 +19,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5752
12
89
61