extend-shallow

中文文档
3.0.2发布于 2017/12/21MITCommonJS近 30 天下载 2.5亿

Extend an object with the properties of additional objects. node.js/javascript util.

原始使用文档
文档目录7 节
  1. Install
  2. Usage
  3. About
  4. Related projects
  5. Contributors
  6. Author
  7. License

extend-shallow NPM version NPM monthly downloads NPM total downloads Linux Build Status

Extend an object with the properties of additional objects. node.js/javascript util.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.

Install

Install with npm:

$ npm install --save extend-shallow

Usage

var extend = require('extend-shallow');

extend({a: 'b'}, {c: 'd'})
//=> {a: 'b', c: 'd'}

Pass an empty object to shallow clone:

var obj = {};
extend(obj, {a: 'b'}, {c: 'd'})
//=> {a: 'b', c: 'd'}

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

You might also be interested in these projects:

  • extend-shallow: Extend an object with the properties of additional objects. node.js/javascript util. | homepage
  • for-in: Iterate over the own and inherited enumerable properties of an object, and return an object… more | homepage
  • for-own: Iterate over the own enumerable properties of an object, and return an object with properties… more | homepage
  • is-plain-object: Returns true if an object was created by the Object constructor. | homepage
  • isobject: Returns true if the value is an object and not an array or null. | homepage
  • kind-of: Get the native type of a value. | homepage

Contributors

| Commits | Contributor | | --- | --- | | 33 | jonschlinkert | | 1 | pdehaan |

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on November 19, 2017.

版本与发布记录

extend-shallow 共发布 13 个版本,首次发布于 2014/10/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.0.2latest2017/12/218 年前
3.0.12017/11/218 年前
3.0.02017/11/198 年前
2.0.12015/07/1711 年前
2.0.02015/06/2911 年前
1.1.42015/05/2211 年前

关于 extend-shallow 的常见问题

extend-shallow 是什么?

Extend an object with the properties of additional objects. node.js/javascript util.

如何安装 extend-shallow?

在项目目录运行 npm install extend-shallow,或使用 pnpm add / yarn add / bun add。

extend-shallow 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/extend-shallow 是否存在。

extend-shallow 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

extend-shallow 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=0.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

extend-shallow 可以商用吗?

extend-shallow 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

extend-shallow 的下载量有多少?

根据 npm 官方下载统计,extend-shallow 在 2026/10/05 – 2026/11/03 这 30 天内被下载 250,199,716 次,日均约 8,339,991 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

extend-shallow 还在维护吗?

最新版本 3.0.2 发布于 2017/12/21(8 年前);至今共发布 13 个版本,其中过去 12 个月发布了 0 个;首次发布于 2014/10/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。