# extend-shallow 中文文档

规范地址：https://npmcn.com/package/extend-shallow/

版本：3\.0\.2
npm 元数据更新时间：2023-07-12T19:12:28.409Z
中文译文更新时间：2026-11-05T16:06:53.126Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/extend-shallow
原文对照：https://npmcn.com/package/extend-shallow/?lang=original
项目主页：https://github.com/jonschlinkert/extend-shallow
源码仓库：https://github.com/jonschlinkert/extend-shallow

## 关键信息（来自 npm 元数据）

- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=0\.10\.0
- 运行依赖：2 个
- 首次发布：2014-10-06T08:44:08.862Z
- 最新版本发布：2017-12-20T19:11:38.344Z
- 近 30 天下载量：250199716（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：13（近 12 个月 0 个）

## 中文简介

以额外对象的属性扩展对象。 节点.js/javascript util. 中国植物物种信息数据库.

## 安装

```sh
npm install extend-shallow
```

也可以使用：`pnpm add extend-shallow`、`yarn add extend-shallow`、`bun add extend-shallow`

## README

# 扩展线 [![NPM version](https://img.shields.io/npm/v/extend-shallow.svg?style=flat)](https://www.npmjs.com/package/extend-shallow) [![NPM monthly downloads](https://img.shields.io/npm/dm/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![NPM total downloads](https://img.shields.io/npm/dt/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/extend-shallow.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/extend-shallow)

> 以额外对象的属性扩展对象。 节点.js/javascript util. 中国植物物种信息数据库.

请考虑跟随这个项目的作者, [乔恩·斯林克特](https://github.com/jonschlinkert),并考虑主演该项目以显示你的:心:和支持.

## 安装

安装方式 [无](https://www.npmjs.com/)数字 :

```sh
$ npm install --save extend-shallow
```

## 使用量

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

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

将空对象传递给浅层克隆 :

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

## 关于

**捐款**

拉出请求和星星总是受欢迎的. 对于错误和特性请求, [请创建一个问题](https://npmcn.com/issues/new)。 。 。 .

**运行测试**

运行和审查单元测试是熟悉图书馆及其API的好办法。 您可以使用以下命令安装依赖性并运行测试:

```sh
$ npm install && npm test
```
**大楼文件**

_(此工程的 readme.md 由 [动词](https://github.com/verbose/verb-generate-readme)请不要直接编辑读取器。 读取器的任何改动必须在 [动词 md](https://npmcn.com/package/extend-shallow/.verb.md) 读取我的模板。 )_

要生成读取, 请运行以下命令 :

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

### 相关项目

您可能也对这些项目感兴趣:

-   [扩展线](https://www.npmjs.com/package/extend-shallow): 以附加对象的属性扩展对象。 节点.js/javascript util. | [主页](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.")
-   [输入](https://www.npmjs.com/package/for-in): 将对象本身的并继承的可假定属性上斜体,并返回对象.. [更多](https://github.com/jonschlinkert/for-in) | [主页](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js")
-   [为所有](https://www.npmjs.com/package/for-own): 以对象本身的可假设属性来排列,然后返回带有属性的对象.. [更多](https://github.com/jonschlinkert/for-own) | [主页](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.")
-   [平面对象](https://www.npmjs.com/package/is-plain-object): 如果对象是由 `Object` 建筑师 [主页](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
-   [对象](https://www.npmjs.com/package/isobject): 如果值是对象而不是数组或数组为无效,则返回真值 [主页](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
-   [类型](https://www.npmjs.com/package/kind-of): 获取一个值的原生类型 。 @ @ info [主页](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")

### 贡献者

| **提交** | **贡献者** | | -- -- -- -- -- -- -- | 33 | [扬施林克特](https://github.com/jonschlinkert) | | 1 | [脚下](https://github.com/pdehaan) |

### 作者

**乔恩·斯林克特**

-   [千兆克/正弦链路](https://github.com/jonschlinkert)
-   [推特/简斯林克特](https://twitter.com/jonschlinkert)

### 许可证

版权:2017年, [乔恩·斯林克特](https://github.com/jonschlinkert)。 。 。 . 释放 [MIT 许可证](https://npmcn.com/package/extend-shallow/LICENSE)。 。 。 .

* * *

_此文件由 [动词基因读取器](https://github.com/verbose/verb-generate-readme),v 6.0,于2017年11月19日查阅._

## 常见问题

### extend-shallow 是什么？

以额外对象的属性扩展对象。 节点\.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 和提交记录判断。

