# just-extend

> extend an object

Latest version **6.2.0** (published 2022-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-extend
pnpm add just-extend
yarn add just-extend
bun add just-extend
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.2.0 |
| Published | 2022-12-17 |
| First published | 2016-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6201 |
| Author | Angus Croll |
| Maintainers | angus-c |
| Keywords | object, assign, clone, copy, merge, deep-copy, extend, no-dependencies, just |

## Links

- npm: https://www.npmjs.com/package/just-extend
- Repository: https://github.com/angus-c/just
- Homepage: https://github.com/angus-c/just#readme
- Issues: https://github.com/angus-c/just/issues
- npm.io page: https://npm.io/package/just-extend

## Recent versions

- 6.2.0 (latest) — 2022-12-17
- 6.1.1 — 2022-08-08
- 6.1.0 — 2022-08-07
- 6.0.1 — 2021-11-13
- 6.0.0 — 2021-11-09
- 5.1.1 — 2021-11-01
- 5.1.0 — 2021-10-31
- 5.0.0 — 2021-10-22
- 4.2.1 — 2021-04-04
- 4.2.0 — 2021-04-04
- 4.1.1 — 2020-09-13
- 4.1.0 — 2020-02-25
- 4.0.2 — 2018-10-30
- 4.0.1 — 2018-10-30
- 4.0.0 — 2018-10-30
- … 23 more at https://npm.io/package/just-extend/versions

## README

<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->

## just-extend

Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

[`🍦 Try it`](https://anguscroll.com/just/just-extend)

```shell
npm install just-extend
```
```shell
yarn add just-extend
```

Extend an object

```js
import extend from 'just-extend';

var obj = {a: 3, b: 5};
extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 4, b: 5, c: 8}

var obj = {a: 3, b: 5};
extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}
obj; // {a: 3, b: 5}

var arr = [1, 2, 3];
var obj = {a: 3, b: 5};
extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push(4);
obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}

var arr = [1, 2, 3];
var obj = {a: 3, b: 5};
extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}
arr.push(4);
obj; // {a: 3, b: 5, c: [1, 2, 3]}

extend({a: 4, b: 5}); // {a: 4, b: 5}
extend({a: 4, b: 5}, 3); {a: 4, b: 5}
extend({a: 4, b: 5}, true); {a: 4, b: 5}
extend('hello', {a: 4, b: 5}); // throws
extend(3, {a: 4, b: 5}); // throws
```

---
_Source: https://npm.io/package/just-extend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
