A minimal yet very useful synchronization primitive on top of jQuery Deferreds that is available as a jQuery plugin client-side and a npm package for node server-side.
Latest version of Fence is version 0.4.0
See our Introduction to Fence.
- use npm:
npm install fence
- or put
fence
as a dependency inpackage.json
Fence itself depends on JQDeferred an automated port of jQuery Deferreds to node.
Once Fence is installed, require
it in your code:
var Fence = require( "fence" );
Download the minified or full-text version of the plugin and drop it into your project.
Then:
- put a script tag to load the plugin in your html:
<script src="path/to/js/fence.0.4.0.js"></script>
- OR use your favorite script loader:
yepnope( "path/to/js/fence.0.4.0.js" );
After that, Fence is available as jQuery.Fence
, that simple.
To build Fence yourself, you need node.
- clone the repository:
git clone git://github.com/jaubourg/fence.git
- enter the newly created directory:
cd fence
- checkout the version you want to build:
git checkout 0.4.0
- install node dependencies:
npm install
- launch the builder:
node .
Node package is now located in dist/node
, jQuery plugin in dist/jquery
.