# @pansy/group-by

> 根据迭代函数返回的值对数组进行分组。

Latest version **0.5.0** (published 2020-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pansy/group-by
pnpm add @pansy/group-by
yarn add @pansy/group-by
bun add @pansy/group-by
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2020-09-12 |
| First published | 2019-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pansy Team |
| Maintainers | wangxingkang |

## Links

- npm: https://www.npmjs.com/package/@pansy/group-by
- npm.io page: https://npm.io/package/@pansy/group-by

## Recent versions

- 0.5.0 (latest) — 2020-09-12
- 0.4.0 — 2020-03-31
- 0.3.6 — 2019-12-20
- 0.3.5 — 2019-12-20
- 0.3.3 — 2019-12-10
- 0.3.2 — 2019-12-08
- 0.3.1 — 2019-12-06
- 0.3.0 — 2019-12-01
- 0.2.1 — 2019-12-01
- 0.2.0 — 2019-11-20
- 0.1.3 — 2019-11-19
- 0.1.2 — 2019-11-18
- 0.1.1 — 2019-11-18
- 0.1.0 — 2019-11-17
- 0.0.4 — 2019-11-17

## README

<h1 align="center">@pansy/group-by</h1>

> 根据迭代函数返回的值对数组进行分组。

## 📦 安装

```
// npm
npm install @pansy/group-by --save

// yarn
yarn add @pansy/group-by

```

## 🔨 使用

```
import groupBy from '@pansy/group-by';

const list = [
  { module: 'module1', action: 'action1' },
  { module: 'module1', action: 'action2' },
  { module: 'module2', action: 'action1' }
];

console.log(groupBy(list, item => item.module));

// => {
// =>   module1: [
// =>     { module: 'module1', action: 'action1' },
// =>     { module: 'module1', action: 'action2' },
// =>   ],
// =>   module2: [
// =>     { module: 'module2', action: 'action1' }
// =>   ]
// => }
```

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