Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The leanest, meanest AMD loader

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 dist
Octocat-spinner-32 lib
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 make.js
Octocat-spinner-32 package.json
Octocat-spinner-32 version.txt
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.