Version 1
[yaffs-website] / node_modules / extend / README.md
1 [![Build Status][travis-svg]][travis-url]
2 [![dependency status][deps-svg]][deps-url]
3 [![dev dependency status][dev-deps-svg]][dev-deps-url]
4
5 # extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>
6
7 `node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.
8
9 ## Installation
10
11 This package is available on [npm][npm-url] as: `extend`
12
13 ``` sh
14 npm install extend
15 ```
16
17 ## Usage
18
19 **Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**
20
21 *Extend one object with one or more others, returning the modified object.*
22
23 Keep in mind that the target object will be modified, and will be returned from extend().
24
25 If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s).
26 Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over.
27 Warning: passing `false` as the first argument is not supported.
28
29 ### Arguments
30
31 * `deep` *Boolean* (optional)
32 If set, the merge becomes recursive (i.e. deep copy).
33 * `target`      *Object*
34 The object to extend.
35 * `object1`     *Object*
36 The object that will be merged into the first.
37 * `objectN` *Object* (Optional)
38 More objects to merge into the first.
39
40 ## License
41
42 `node-extend` is licensed under the [MIT License][mit-license-url].
43
44 ## Acknowledgements
45
46 All credit to the jQuery authors for perfecting this amazing utility.
47
48 Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].
49
50 [travis-svg]: https://travis-ci.org/justmoon/node-extend.svg
51 [travis-url]: https://travis-ci.org/justmoon/node-extend
52 [npm-url]: https://npmjs.org/package/extend
53 [mit-license-url]: http://opensource.org/licenses/MIT
54 [github-justmoon]: https://github.com/justmoon
55 [github-insin]: https://github.com/insin
56 [github-ljharb]: https://github.com/ljharb
57 [npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg
58 [deps-svg]: https://david-dm.org/justmoon/node-extend.svg
59 [deps-url]: https://david-dm.org/justmoon/node-extend
60 [dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg
61 [dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies
62