[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
# extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>
`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.
Notes:
* Since Node.js >= 4,
[`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
now offers the same functionality natively (but without the "deep copy" option).
See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6).
* Some native implementations of `Object.assign` in both Node.js and many
browsers (since NPM modules are for the browser too) may not be fully
spec-compliant.
Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for
a compliant candidate.
## Installation
This package is available on [npm][npm-url] as: `extend`
``` sh
npm install extend
```
## Usage
**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**
*Extend one object with one or more others, returning the modified object.*
**Example:**
``` js
var extend = require('extend');
extend(targetObject, object1, object2);
```
Keep in mind that the target object will be modified, and will be returned from extend().
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).
Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over.
Warning: passing `false` as the first argument is not supported.
### Arguments
* `deep` *Boolean* (optional)
If set, the merge becomes recursive (i.e. deep copy).
* `target` *Object*
The object to extend.
* `object1` *Object*
The object that will be merged into the first.
* `objectN` *Object* (Optional)
More objects to merge into the first.
## License
`node-extend` is licensed under the [MIT License][mit-license-url].
## Acknowledgements
All credit to the jQuery authors for perfecting this amazing utility.
Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].
[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg
[travis-url]: https://travis-ci.org/justmoon/node-extend
[npm-url]: https://npmjs.org/package/extend
[mit-license-url]: http://opensource.org/licenses/MIT
[github-justmoon]: https://github.com/justmoon
[github-insin]: https://github.com/insin
[github-ljharb]: https://github.com/ljharb
[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg
[deps-svg]: https://david-dm.org/justmoon/node-extend.svg
[deps-url]: https://david-dm.org/justmoon/node-extend
[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg
[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies
程序员张小妍
- 粉丝: 1w+
- 资源: 3691
最新资源
- 博途S7-1200主站与S7-200从站实现RS485通讯程序 S7-200可以当作一个仪表
- C#、C++分别开发的OPC DA CLIENT软件. 1、枚举服务器名称; 2、连接服务器以后枚举出TAG; 3、根据TAG名称自动读取服务器数据; 4、图片内有OPC SERVER和CLIENT实
- python-workspace.zip.005
- 龙门上下料样本程序,四轴 用台达AS228T和台达触摸屏编写 注意软件是用台达新款软件ISPSOFT ,借鉴价值高,程序有注释
- 一款window下的串口监视抓包工具
- 欧姆龙CP1H与3台力士乐VFC-x610变频器通讯程序 功能:原创程序,可直接用于现场程序 欧姆龙CP1H的CIF11通讯板,实现对3台力士乐VFC-x610变频器 设定频率,控制正反转,读取实际
- dp111113333
- CV-密集人群图像数据集(5800张图片).rar
- 福特汽车主观评价规范,性能开发参考,英文原版直译,评价条目、规则描述非常细致 包含平顺舒适性,转向,操稳,NVH,制动,加速感,驾驶性等等性能,并详细描述了评价的准备工作 评价条目细分至第四级,共
- 三菱FX3S两轴标准程序,XZ两轴,包含轴点动,回零,相对与绝对定位,只要弄明白这个程序,就可以非常了解整个项目的程序如何去编写,从哪里开始下手,可提供程序问题解答,程序流程清晰明了,注释完整
- MATLAB代码:考虑P2G与碳捕集机组的多能微网低碳经济调度 关键词:碳交易 阶梯碳交易 碳捕集 多能微网 低碳调度 仿真平台:MATLAB+yalmip+cplex 主要内容:代码主要做的是一个
- 本程序采用matlab编写,主要是实现电流注入型牛拉法 除此之外,本人还编写了很多种关于潮流计算的程序,主要有牛拉法,前推回代法,以还有相和三相潮流计算程序
- 智能门锁架构图,供大家参考
- 三菱FX3U六轴标准程序,程序包含本体3轴控制,扩展3个1PG定位模块,一共六轴 程序有轴点动控制,回零控制,相对定位,绝对定位 另有气缸数个,一个大是DD马达控制的转盘,整个是转盘多工位流水作业
- 批量登录到远程Linux服务器检查服务器时间差的shell
- MATLAB电动车七自由度整车模型 MATLAB Simulink电动车转弯制动abs模型asr转弯制动防抱死abs模型+模糊控制算法+七自由度整车模型+纵向运动+侧向运动+横摆运动+四轮魔术公式+四
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
前往页