Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The leanest, meanest AMD loader
JavaScript
branch: master
Failed to load latest commit information.
dist New build
lib Cleaned up module logic, no need to have a multi-tier object, just st…
tests Updated tests
.gitignore Adding .gitignore
.gitmodules
Makefile New build, version bump for release candidate. All tests passing for …
README.md
make.js
package.json
version.txt Version bump

README.md

NeedsJS

A lean and mean AMD loader

Features:

  • The smallest AMD loader. Less than 2kb! (minified and gzipped)
  • Fully compliant with the latest AMD specification
  • Plugin support. Works with most (if not all) RequireJS plugins.
  • Build/optimization tool coming soon

Supported Browsers:

  • IE 6+
  • FireFox 2+
  • Chrome 1+
  • Safari 3+
  • Opera 9+

Getting Started

Grab the src from dist/needs-latest-min.js and include it in place of your current AMD loader.

NeedsJS mirrors RequireJS in its API. The currently supported configuration options are:

  • baseUrl
  • urlArgs
  • paths
  • waitSeconds

You can also specify plugin-specific configuration options the same way you do so in RequireJS.

require.config({
    baseUrl: "/root/path",
    paths: {
        "modules": "sub/path/modules"
    },
    urlArgs: (+ new Date()) // Useful for disabling caching of JS files during dev,

    somePlugin : {
        // Plugin specific config for `somePlugin` goes here.
    }
});

Note that you have to explicitly call require.config(). unlike RequireJS, you can't set a global object named require.

For more info on AMD in general, usage and formats you can refer to the docs at RequireJS

You can grab and run the unit tests for Needs.JS here

License

The MIT License

(c) 2012 Taka Kojima (the "Author"). All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.