# @ydbjs/abortable

> Utilities for working with AbortController and AbortSignal in YDB operations.

Latest version **6.1.0** (published 2026-03-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ydbjs/abortable
pnpm add @ydbjs/abortable
yarn add @ydbjs/abortable
bun add @ydbjs/abortable
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2026-03-16 |
| First published | 2025-06-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 82 |
| Author | YDB Team |
| Maintainers | ydb-platform |
| Keywords | abort, abortable, cancellation, database, signal, typescript, ydb |

## Links

- npm: https://www.npmjs.com/package/@ydbjs/abortable
- Repository: https://github.com/ydb-platform/ydb-js-sdk
- Homepage: https://github.com/ydb-platform/ydb-js-sdk#readme
- Issues: https://github.com/ydb-platform/ydb-js-sdk/issues
- npm.io page: https://npm.io/package/@ydbjs/abortable

## 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

- 6.1.0 (latest) — 2026-03-16
- 6.0.0-alpha.29 (alpha) — 2025-06-29
- 6.0.5 — 2025-11-04
- 6.0.4 — 2025-10-11
- 6.0.3 — 2025-10-11
- 6.0.2 — 2025-10-11
- 6.0.1 — 2025-10-11
- 6.0.0 — 2025-09-23
- 7.0.0-alpha.33 — 2025-09-08
- 6.0.1-alpha.32 — 2025-07-11
- 6.0.1-alpha.31 — 2025-07-09
- 6.0.1-alpha.30 — 2025-07-02

## README

# YDB JavaScript SDK

[![Docs](https://ydb.js.org/)](https://ydb.js.org/) [![codecov](https://codecov.io/gh/ydb-platform/ydb-js-sdk/graph/badge.svg)](https://ydb-appteam-sdk-reports.website.yandexcloud.net/ydb-js-sdk/coverage/)

Modern, modular SDK for YDB in TypeScript/JavaScript.

- Type‑safe YQL queries with tagged templates
- Automatic parameter binding and transactions
- Rich value/type system with `@ydbjs/value`
- Clear errors, retries, and diagnostics

## Other versions

- [v5](https://github.com/ydb-platform/ydb-js-sdk/tree/v5)
- [v4](https://github.com/ydb-platform/ydb-js-sdk/tree/v4.7.0)

---

## Packages

- [`@ydbjs/core`](./packages/core): Core connection and utilities
- [`@ydbjs/query`](./packages/query): YQL queries, transactions, parameters
- [`@ydbjs/coordination`](./packages/coordination): Coordination nodes and distributed semaphores
- [`@ydbjs/value`](./packages/value): YDB types and values
- [`@ydbjs/api`](./packages/api): gRPC/Protobuf service definitions
- [`@ydbjs/error`](./packages/error): YDB error handling
- [`@ydbjs/auth`](./packages/auth): Authentication (tokens, anonymous, metadata)
- [`@ydbjs/retry`](./packages/retry): Flexible retry policies

---

## Quick Start

### 1) Install

```sh
npm install @ydbjs/core @ydbjs/query
```

### 2) Connect and Query

```ts
import { Driver } from '@ydbjs/core'
import { query } from '@ydbjs/query'

const driver = new Driver('grpc://localhost:2136/local')
await driver.ready()

const sql = query(driver)
const resultSets = await sql`SELECT 1 + 1 AS sum`
console.log(resultSets) // [ [ { sum: 2 } ] ]
```

---

## Documentation

- [@ydbjs/core](./packages/core/README.md)
- [@ydbjs/query](./packages/query/README.md)
- [@ydbjs/coordination](./packages/coordination/README.md)
- [@ydbjs/value](./packages/value/README.md)
- [@ydbjs/api](./packages/api/README.md)
- [@ydbjs/error](./packages/error/README.md)
- [@ydbjs/auth](./packages/auth/README.md)
- [@ydbjs/retry](./packages/retry/README.md)

Project docs:

- [Releasing](./RELEASING.md)
- [Versioning](./VERSIONING.md)
- [Contributing](./CONTRIBUTING.md)

---

## Examples

Examples

- Parameterized query:

```ts
import { Int64, Optional, PrimitiveType } from '@ydbjs/value'
const sql = query(driver)
await sql`SELECT ${new Optional(new Int64(100n), new PrimitiveType('INT64'))};`
```

– Transactions:

```ts
await sql.begin(async (tx, signal) => {
  await tx`INSERT INTO users (id, name) VALUES (1, 'Alice')`
  await tx`UPDATE users SET name = 'Bob' WHERE id = 1`
})
```

– Error handling:

```ts
import { YdbError } from '@ydbjs/error'
try {
  await sql`SELECT * FROM non_existent_table`
} catch (e) {
  if (e instanceof YdbError) {
    console.error('YDB Error:', e.message)
  }
}
```

---

## AI Assistant Configuration

For projects using YDB SDK, you can configure AI assistants (GitHub Copilot, Cursor, etc.) to generate secure YQL code.

Multiple example configuration files are provided in `packages/query/ai-instructions/`:

- `.cursorrules.example` - Cursor AI instructions
- `.instructions.example.md` - General AI assistant guidelines
- `.copilot-instructions.example.md` - GitHub Copilot specific
- `.ai-instructions.example.md` - Alternative general format

Copy the appropriate file to your project root to enable secure AI code generation that follows YDB security best practices.

---

## FAQ

- **Add a new service?** Use `@ydbjs/api` for gRPC definitions.
- **Work with YDB types?** Use `@ydbjs/value`.
- **Implement retries?** Use `@ydbjs/retry`.
- **More examples?** See package docs, [local examples](https://github.com/ydb-platform/ydb-js-sdk/tree/main/examples), or explore [ydb-js-examples](https://github.com/ydb-platform/ydb-js-examples) repository with comprehensive real-world examples.

---

## Developer Guide

- Build: `npm run build`
- Test (all): `npm test`
- Lint: `npm run lint`

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