Skip to content

Commit

Permalink
Adding documentation for API.
Browse files Browse the repository at this point in the history
  • Loading branch information
doctyper committed Jun 4, 2013
1 parent d62b7da commit 0761fcd
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,31 @@ serve the root dir, `<url>/test/modular.html`
* It should be just a big list of things you can build with no frills.


### API Reference

Modernizr can be used programmatically via npm:

```node
var modernizr = require("modernizr");
```

#### Building

A `build` method is exposed for generating custom Modernizr builds. Example:

```node
var modernizr = require("modernizr");

var result = modernizr.build({}, function (result) {
console.log(result.code); // full source
console.log(result.min); // minfied output
});
```

The first parameter takes a JSON object of options and feature-detects to include. See [`lib/config-all.json`](lib/config-all.json) for all available options.

The second parameter is a function invoked on task completion.

## License

MIT license

0 comments on commit 0761fcd

Please sign in to comment.