# @mohayonao/append-if-not-exists

> append if not exists

Latest version **1.0.0** (published 2015-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mohayonao/append-if-not-exists
pnpm add @mohayonao/append-if-not-exists
yarn add @mohayonao/append-if-not-exists
bun add @mohayonao/append-if-not-exists
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-08-25 |
| First published | 2015-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mohayonao |
| Maintainers | mohayonao |

## Links

- npm: https://www.npmjs.com/package/@mohayonao/append-if-not-exists
- Repository: https://github.com/mohayonao/append-if-not-exists/
- Issues: https://github.com/mohayonao/append-if-not-exists/issues
- npm.io page: https://npm.io/package/@mohayonao/append-if-not-exists

## Recent versions

- 1.0.0 (latest) — 2015-08-25

## README

# append-if-not-exists
[![Build Status](http://img.shields.io/travis/mohayonao/append-if-not-exists.svg?style=flat-square)](https://travis-ci.org/mohayonao/append-if-not-exists)
[![NPM Version](http://img.shields.io/npm/v/@mohayonao/append-if-not-exists.svg?style=flat-square)](https://www.npmjs.org/package/@mohayonao/append-if-not-exists)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)

> append if not exists

## Installation

```
npm install @mohayonao/append-if-not-exists
```

## API
- `appendIfNotExists(array: any[], target: any): boolean`
  - append `target` if not exists in `array`
  - return true if appended

## Example

```js
import appendIfNotExists from "@mohayonao/append-if-not-exists";

let array = [ 1, 2, 3, 4, 5 ];

console.log(appendIfNotExists(array, 6)); // true
console.log(array); // [ 1, 2, 3, 4, 5, 6 ]

console.log(appendIfNotExists(array, 3)); // false
console.log(array); // [ 1, 2, 3, 4, 5, 6 ]
```

## License
MIT

---
_Source: https://npm.io/package/@mohayonao/append-if-not-exists · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
