# @rsql/emitter

> RSQL Emitter

Latest version **1.6.0** (published 2023-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rsql/emitter
pnpm add @rsql/emitter
yarn add @rsql/emitter
bun add @rsql/emitter
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2023-05-12 |
| First published | 2020-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 8 |
| Dependencies | 1 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 54 |
| Author | Piotr Oleś |
| Maintainers | piotr-oles |
| Keywords | rsql, fiql, emitter |

## Links

- npm: https://www.npmjs.com/package/@rsql/emitter
- Repository: https://github.com/piotr-oles/rsql
- Homepage: https://github.com/piotr-oles/rsql#readme
- Issues: https://github.com/piotr-oles/rsql/issues
- npm.io page: https://npm.io/package/@rsql/emitter

## Dependencies (1)

- [@rsql/ast](https://npm.io/package/@rsql/ast.md) ^1.6.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.6.0 (latest) — 2023-05-12
- 1.0.2-canary.10.71f98a5.0 (canary) — 2020-09-29
- 0.0.1-next.3 (next) — 2020-05-10
- 1.5.2 — 2023-01-16
- 1.5.1 — 2023-01-08
- 1.5.0 — 2022-12-05
- 1.4.1 — 2022-12-05
- 1.4.0 — 2022-07-08
- 1.3.3 — 2022-06-29
- 1.3.2 — 2022-03-27
- 1.3.1 — 2022-02-13
- 1.3.0 — 2022-02-13
- 1.2.4 — 2021-09-22
- 1.2.3 — 2021-09-03
- 1.2.2 — 2021-08-12
- … 15 more at https://npm.io/package/@rsql/emitter/versions

## README

# @rsql/emitter

RSQL emitter for Node.js and Browsers

[![npm](https://img.shields.io/npm/v/@rsql/emitter)](https://www.npmjs.com/package/@rsql/emitter)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![auto release](https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto)](https://github.com/intuit/auto)

## Installation

```sh
# with npm
npm install --save @rsql/emitter

# with yarn
yarn add @rsql/emitter
```

## API

#### `emit(expression: ExpressionNode, options?: EmitOptions): string`

Emits RSQL string from the Abstract Syntax Tree. The second parameter to `emit` is an optional object with the following
fields:

- `preferredQuote` - Optional string. The preferred quote character to use when `emit` encounters a comparison value
  that needs to be escaped by wrapping in quotes. Either `"` (the ASCII double quote character) or `'` (the ASCII single
  quote character). Defaults to `"` (the ASCII double quote character).

- `optimizeQuotes` - Optional boolean. If `true`, `emit` will override the `preferredQuote` setting on a comparison
  value-by-comparison value basis if doing so would shorten the emitted RSQL. If `false`, `emit` will use the
  `preferredQuote` as the quote character for all comparison values encountered. Defaults to `true`.

`emit` can throw the following errors:

- `TypeError` - in the case of invalid argument type passed to the `emit` function

## License

MIT

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