# slonik-interceptor-json-rows

> Slonik Json Interceptor

Latest version **1.0.0** (published 2022-05-27) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install slonik-interceptor-json-rows
pnpm add slonik-interceptor-json-rows
yarn add slonik-interceptor-json-rows
bun add slonik-interceptor-json-rows
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-05-27 |
| First published | 2022-05-27 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 1 |
| Unpacked size | 33.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Alen |
| Maintainers | alendavid |
| Keywords | postgresql, promise, types, slonik |

## Links

- npm: https://www.npmjs.com/package/slonik-interceptor-json-rows
- Funding: https://patreon.com/davidalen
- npm.io page: https://npm.io/package/slonik-interceptor-json-rows

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-05-27

## README

![test workflow](https://github.com/alendavid/slonik-interceptor-json-rows/actions/workflows/test.yml/badge.svg)

# Slonik Json Interceptor

Transform [slonik](https://www.npmjs.com/package/slonik)'s QueryResultRow key into json-ready objects.

## API usage

```js
import { createPool } from 'slonik';

import JsonInterceptor from 'slonik-json-row-interceptor';

const pool = createPool(connectionString, {
  interceptors: [JsonInterceptor]
});

pool.connect(async (connection) => {
  const query = sql`select
    u.id,
    u.name,
    c.id as "cars.id",
    c.name as "cars.name"
  from
    users u
      join cars c
      on u.id = c.owner;`;

  const results = await connection.many(query);
  console.log(results); // [ { id: 1, name: 'Foo', cars: { id: 1, name: 'Bar' } } ]
});
```

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