# sext

> Emulates jQuery's $.extend()

Latest version **0.1.6** (published 2015-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install sext
pnpm add sext
yarn add sext
bun add sext
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2015-01-06 |
| First published | 2014-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | fluffybunnies |
| Maintainers | fluffybunnies |
| Keywords | extend, merge, copy, object |

## Links

- npm: https://www.npmjs.com/package/sext
- Repository: git@github.com:fluffybunnies/sext
- Homepage: https://github.com/fluffybunnies/sext
- Issues: https://github.com/fluffybunnies/sext/issues
- npm.io page: https://npm.io/package/sext

## Recent versions

- 0.1.6 (latest) — 2015-01-06
- 0.1.5 — 2015-01-06
- 0.1.4 — 2015-01-06
- 0.1.3 — 2015-01-06
- 0.1.2 — 2015-01-06
- 0.1.1 — 2015-01-06
- 0.1.0 — 2015-01-06
- 0.0.10 — 2014-04-04
- 0.0.9 — 2014-04-03
- 0.0.8 — 2014-04-02
- 0.0.7 — 2014-04-02
- 0.0.6 — 2014-04-02
- 0.0.5 — 2014-04-02
- 0.0.4 — 2014-04-02
- 0.0.3 — 2014-04-02
- … 2 more at https://npm.io/package/sext/versions

## README

[![Build Status](https://secure.travis-ci.org/fluffybunnies/sext.png)](http://travis-ci.org/fluffybunnies/sext)

## Description

Simple extend (sext) emulates jQuery's $.extend except:
- undefined values are not ignored
- numeric object keys are transferred to target arrays

Optional deep extend. Silently ignores non Objects.

```
sext( [deep,] target [,obj1 [,objN]] )
```

## Sextamples

#### Copy
```
var sext = require('sext')

var pirateOg = {name: 'Pompeius'}
var pirateNb = sext({}, pirateOg)

console.log(pirateNb);
// { name: 'Pompeius' }
```

#### Extend
```
var sext = require('sext')

var f1 = new Function
f1.prototype.giveMeCheese = function(){
  return 'brie'
}

var f2 = new Function
f2.prototype.giveMeWine = function(){
  return 'zin'
}

sext(f1.prototype,f2.prototype)
var waiter = new f1()

console.log( waiter.giveMeWine() )
// 'zin'
```

#### Arrays work too
```
var sext = require('sext')

var o1 = [{color:'blue', facial_expression:'happy'}, 12]
var o2 = [{color:'pomegranate'}]

var o = sext([], o1, o2)
console.log(o)
// [ { color: 'pomegranate' }, 12 ]

var o = sext(true, [], o1, o2)
console.log(o)
//[ { color: 'pomegranate', facial_expression: 'happy' }, 12 ]
```

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