# postgres-array

> Parse postgres array columns

Latest version **3.0.4** (published 2025-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install postgres-array
pnpm add postgres-array
yarn add postgres-array
bun add postgres-array
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.4 |
| Published | 2025-03-06 |
| First published | 2015-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | postgres, array, parser |

## Links

- npm: https://www.npmjs.com/package/postgres-array
- Repository: https://github.com/bendrucker/postgres-array
- Homepage: https://github.com/bendrucker/postgres-array#readme
- Issues: https://github.com/bendrucker/postgres-array/issues
- npm.io page: https://npm.io/package/postgres-array

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.4 (latest) — 2025-03-06
- 3.0.3 — 2025-03-05
- 3.0.2 — 2023-02-08
- 3.0.1 — 2020-10-29
- 3.0.0 — 2020-10-29
- 2.0.0 — 2018-10-22
- 1.0.3 — 2018-09-17
- 1.0.2 — 2016-12-09
- 1.0.1 — 2016-12-09
- 1.0.0 — 2015-06-12

## README

# postgres-array [![tests](https://github.com/bendrucker/postgres-array/workflows/tests/badge.svg)](https://github.com/bendrucker/postgres-array/actions?query=workflow%3Atests)

> Parse postgres array columns


## Install

```
npm install --save postgres-array
```


## Usage

```js
const { parse } = require('postgres-array')

parse('{1,2,3}', (value) => parseInt(value, 10))
//=> [1, 2, 3]
```

## API

#### `parse(input, [transform])` -> `array`

##### input

*Required*  
Type: `string`

A Postgres array string.

##### transform

Type: `function`  
Default: `identity`

A function that transforms non-null values inserted into the array.


## License

MIT © [Ben Drucker](http://bendrucker.me)

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