1.0.0 • Published 7 years ago

normify v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

normify

Makes browser APIs behave in the standard way

Purpose

Web APIs are becoming more standardised and browsers tend to follow them, by and large. There are still exceptions where browser vendors make deliberate changes to break with well-established norms --- breaking existing code on the web.

Normify addresses this by monkey patching APIs, where necessary, to make misbehaving browsers follow the norm. You can drop normify into your app with just a single line of code.

To keep the project flexible and modular, normify depends on packages that do the real work to fix individual APIs:

You can use particular normify-* subpackages as needed, or you can use normify to automatically use all of them.

Please file an issue to report a browser issue that Normify does not yet handle.

Installation

Install with npm:

npm install --save normify

Usage

However you use the normify module, it is important that you call it before any of your other code so that its fixes are applied first.

CommonJS require():

require('normify')();

ES2015 import:

import normify from 'normify';

normify();

Browser globals:

Download normify-bundle.js from the dist directory, and include in your HTML file:

<script src="normify-bundle.js"></script>
<script>normify();</script>

AMD:

Use normify.js or normify-bundle.js from the dist directory:

require( ['normify'], function( normify ){
  normify();
} );

Options

The normify( options ) function takes an options object that allowing configuring the individual packages that normify uses: