# @beanstalk/core

> Yet another Beanstalkd client library

Latest version **0.3.7** (published 2020-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @beanstalk/core
pnpm add @beanstalk/core
yarn add @beanstalk/core
bun add @beanstalk/core
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.7 |
| Published | 2020-12-16 |
| First published | 2020-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 79 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Maxime Tricoire |
| Maintainers | leiko |

## Links

- npm: https://www.npmjs.com/package/@beanstalk/core
- Repository: https://github.com/maxleiko/beanstalk-core
- npm.io page: https://npm.io/package/@beanstalk/core

## Recent versions

- 0.3.7 (latest) — 2020-12-16
- 0.3.6 — 2020-12-15
- 0.3.5 — 2020-12-15
- 0.3.4 — 2020-12-15
- 0.3.3 — 2020-12-15
- 0.3.2 — 2020-12-15
- 0.3.1 — 2020-10-26
- 0.3.0 — 2020-09-10
- 0.2.2 — 2020-08-30
- 0.2.1 — 2020-08-30
- 0.2.0 — 2020-08-30
- 0.1.4 — 2020-08-30
- 0.1.3 — 2020-08-30
- 0.1.2 — 2020-08-30
- 0.1.1 — 2020-08-29
- … 1 more at https://npm.io/package/@beanstalk/core/versions

## README

## @beanstalk/core

![build](https://img.shields.io/github/workflow/status/maxleiko/beanstalk-core/build) | ![npm](https://img.shields.io/npm/v/@beanstalk/core)

[Documentation](https://maxleiko.github.io/beanstalk-core/)

A 0 dependency, full-featured, battle-tested beanstalk client library.  

> **NOTE**  
> While version is lower than `v1.0.0` the API might change slightly

### Installation
```sh
yarn add @beanstalk/core
```

### Usage
#### PUT
```ts
import { BeanstalkClient } from '@beanstalk/core';

/**
 * Usage: node put.js
 */
async function main() {
  const client = new BeanstalkClient();
  await client.connect(); // defaults to localhost:11300

  const id = await client.put('Hello World');
  console.log(`Job created with '${id}'`);

  client.quit();
}

main().catch((err) => {
  console.error(err.message);
  process.exit(1);
});
```

#### RESERVE
```ts
import { BeanstalkClient } from '@beanstalk/core';

/**
 * Usage: node reserve.js > out
 */
async function main() {
  const client = new BeanstalkClient();
  await client.connect(); // defaults to localhost:11300

  await client.watch('my-tube');
  await client.ignore('default'); // 'default' is watched by default

  // hangs until a job gets ready on 'my-tube'
  const [id, payload] = await client.reserve();
  console.error(`Job ID: ${id}`);
  await new Promise((resolve, reject) => {
    process.stdout.write(payload, (err) => err ? reject(err) : resolve());
  });

  client.quit();
}

main().catch((err) => {
  console.error(err.message);
  process.exit(1);
});
```

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