# nucleic

> For building Bitcoin-powered applications in Node.js Typescript.

Latest version **0.5.1** (published 2022-02-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install nucleic
pnpm add nucleic
yarn add nucleic
bun add nucleic
```

Provides the command `nucleic`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2022-02-04 |
| First published | 2022-01-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 79.8 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | stevenzeiler |

## Links

- npm: https://www.npmjs.com/package/nucleic
- npm.io page: https://npm.io/package/nucleic

## Dependencies (16)

- [pg](https://npm.io/package/pg.md) ^8.7.1
- [bsv](https://npm.io/package/bsv.md) ^2.0.10
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [axios](https://npm.io/package/axios.md) ^0.25.0
- [redis](https://npm.io/package/redis.md) ^4.0.2
- [dotenv](https://npm.io/package/dotenv.md) ^15.0.0
- [split2](https://npm.io/package/split2.md) ^4.1.0
- [filepay](https://npm.io/package/filepay.md) ^2.2.12
- [ts-node](https://npm.io/package/ts-node.md) ^10.4.0
- [through2](https://npm.io/package/through2.md) ^4.0.2
- [commander](https://npm.io/package/commander.md) ^9.0.0
- [sequelize](https://npm.io/package/sequelize.md) ^6.14.0
- [async-redis](https://npm.io/package/async-redis.md) ^2.0.0
- [eventsource](https://npm.io/package/eventsource.md) ^1.1.0
- [@types/redis](https://npm.io/package/@types/redis.md) ^4.0.11
- [replacestream](https://npm.io/package/replacestream.md) ^4.0.3

## Recent versions

- 0.5.1 (latest) — 2022-02-04
- 0.5.0 — 2022-02-04
- 0.4.0 — 2022-02-01
- 0.3.1 — 2022-01-30
- 0.3.0 — 2022-01-25
- 0.2.0 — 2022-01-25
- 0.1.1 — 2022-01-25
- 0.1.0 — 2022-01-25
- 0.0.2 — 2022-01-23
- 0.0.1 — 2022-01-23

## README

# Nucleic

For building Bitcoin-powered applications in Node.js Typescript.

### Usage

```
import { PlanariaCrawler } from 'nucleic'

class Crawler extends PlanariaCrawler {

  query: {
    // see https://bitquery.planaria.network for query syntax
  }

  async getBlockIndex() {
    // optional override 
  }

  async setBlockIndex() {
    // optional override 
  }

  async onTransaction(transaction) {
    // override to receive transactions
  }

  async persistTransction(transaction) {
    // optional override to persist transaction if not persisted
  }

}

(aysnc () => {

  let crawler = new Crawler(process.env.PLANARIA_TOKEN)

  // optional event emitter in addition to onTransaction callback
  crawler.on('transaction', (transaction) => {

  })

  // crawler will catch all errors silently and it an error event
  crawler.on('error', (error) => {

  })

  // awaiting crawler will crawl forever until stopped
  crawler.on('transaction', crawler.stop)

  await crawler.start()

}()

```

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