Extraction of jQuery.extend; tested and proven for your use in node.js projects
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
LICENSE
README.md
extend.js
package.json

README.md

jquery-extend

The point of this module is to provide the most up-to-date version of jQuery's .extend function for server-side use.

This function's operation is 100% backed by jQuery's own testing suite.

The API is identical to jQuery.extend

Example

var extend = require("jquery-extend");
var a = {a: {b: "c", d: "e"}};
var b = {a: {b: "x", f: "g"}};

// shallow copy
extend({}, a, b);       //=> {a: {b: "x", f: "g"}}

// deep copy
extend(true, {}, a, b); //=> {a: {b: "x", d: "e", f: "g"}}

Installation

You can specify which version of the jQuery.extend function you want to use in your package.json file

2.x

{
  "dependencies": {
    "jquery-extend": "2.0.3"
  }
}

or 1.x

{
  "dependencies": {
    "jquery-extend": "1.10.2"
  }
}

Versions

Current supported versions

  • 2.0.3
  • 1.10.2

Tests

All versions are tested and working 100% compared to jQuery's own QUnit testing suite. To run the tests in node, you will need qunit

Then run

$ npm test

License

Copyright 2013 jQuery Foundation and other contributors http://jquery.com/