# @jswork/next-unique

> Unique for array based on next.

Latest version **1.0.3** (published 2026-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jswork/next-unique
pnpm add @jswork/next-unique
yarn add @jswork/next-unique
bun add @jswork/next-unique
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-05-04 |
| First published | 2020-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | afei |
| Maintainers | afeiship, yujiao.luo |
| Keywords | unique, next, uniq |

## Links

- npm: https://www.npmjs.com/package/@jswork/next-unique
- Homepage: https://js.work
- npm.io page: https://npm.io/package/@jswork/next-unique

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2026-05-04
- 1.0.2 — 2025-10-17
- 1.0.1 — 2021-05-31
- 1.0.0 — 2020-11-21

## README

# next-unique
> Unique for array based on next.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-unique
```

## usage
```js
import '@jswork/next-unique';

// Simple array
const array1 = [1, 2, 4, 5, 6, 7, 1, 2];
nx.unique(array1);
// => [1, 2, 4, 5, 6, 7]

// Object array with key
const array2 = [
  { id: 1, value: 'value1' },
  { id: 2, value: 'value2' },
  { id: 1, value: 'value1' }
];
nx.unique(array2, 'id');
// => [{ id: 1, value: 'value1' }, { id: 2, value: 'value2' }]

// Deep object array
const array3 = [
  { user: { info: { id: 1 }, name: 'John' } },
  { user: { info: { id: 2 }, name: 'Jane' } },
  { user: { info: { id: 1 }, name: 'Bob' } }
];
nx.unique(array3, 'user.info.id');
// => [{ user: { info: { id: 1 }, name: 'John' } }, { user: { info: { id: 2 }, name: 'Jane' } }]
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-unique/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-unique
[version-url]: https://npmjs.org/package/@jswork/next-unique

[license-image]: https://img.shields.io/npm/l/@jswork/next-unique
[license-url]: https://github.com/afeiship/next-unique/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-unique
[size-url]: https://github.com/afeiship/next-unique/blob/master/dist/next-unique.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-unique
[download-url]: https://www.npmjs.com/package/@jswork/next-unique

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