# cassandra-nodetool

> Cassandra Nodetool on Node.js

Latest version **0.1.0** (published 2019-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install cassandra-nodetool
pnpm add cassandra-nodetool
yarn add cassandra-nodetool
bun add cassandra-nodetool
```

Provides the command `jsnodetool`.

## 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.1.0 |
| Published | 2019-01-30 |
| First published | 2019-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.10.1 |
| Dependencies | 2 |
| Unpacked size | 179.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | aoinu |
| Maintainers | aoinu |

## Links

- npm: https://www.npmjs.com/package/cassandra-nodetool
- Repository: https://github.com/Aoinu/cassandra-nodetool
- Homepage: https://github.com/Aoinu/cassandra-nodetool#readme
- Issues: https://github.com/Aoinu/cassandra-nodetool/issues
- npm.io page: https://npm.io/package/cassandra-nodetool

## Dependencies (2)

- [jmx](https://npm.io/package/jmx.md) ^0.7.0
- [argparse](https://npm.io/package/argparse.md) ^1.0.10

## Recent versions

- 0.1.0 (latest) — 2019-01-30
- 0.0.4 — 2019-01-29
- 0.0.3 — 2019-01-27
- 0.0.2 — 2019-01-27
- 0.0.1 — 2019-01-26

## README

# Cassandra Nodetool

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![npm version](https://badge.fury.io/js/cassandra-nodetool.svg)](https://badge.fury.io/js/cassandra-nodetool)
[![david-dm](https://david-dm.org/Aoinu/cassandra-nodetool.svg)](https://david-dm.org/Aoinu/cassandra-nodetool)
[![CircleCI](https://circleci.com/gh/Aoinu/cassandra-nodetool.svg?style=svg)](https://circleci.com/gh/Aoinu/cassandra-nodetool)
[![codecov](https://codecov.io/gh/Aoinu/cassandra-nodetool/branch/master/graph/badge.svg)](https://codecov.io/gh/Aoinu/cassandra-nodetool)

Cassandra Nodetool on Node.js

## Requirements

- Node.js: `>=7.10.1`. (needs `async/await` support)
- Package: [`node-java`](https://github.com/joeferner/node-java), [`node-jmx`](https://github.com/zuazo/node-jmx)
  - OpenJDK: `8`.
  - node-gyp
    - python: `2.7.x`.
    - make
    - g++

## Installation

```
$ npm install cassandra-nodetool
```

or

```
$ yarn add cassandra-nodetool
```

[Dockerfile](https://gitlab.com/aoinu/cassandra-nodetool/blob/master/Dockerfile)

## CLI Usage examples

CLI is available via `jsnodetool`.

```
$ jsnodetool -h

usage: jsnodetool [-h] [-v] [-H HOST] [-P PORT] [-U USERNAME] [-PW PASSWORD]
                  {status} ...

Cassandra Nodetool on Node.js

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -H HOST, --host HOST  Hostname or IP address.
  -P PORT, --port PORT  JMX Port number.
  -U USERNAME, --username USERNAME
                        JMX Username.
  -PW PASSWORD, --password PASSWORD
                        JMX Password.

command:
  {status}
```

To fetch ring status:

```
$ jsnodetool status --skipTokens

{ datacenter1:
   { rack1:
      { '127.0.0.1':
         { hostId: '510e4833-317e-4d11-8590-fd1f849bafd8',
           datacenter: 'datacenter1',
           rack: 'rack1',
           status: 'U',
           state: 'N',
           load: '280.45 KiB',
           ownership: 1.0000048875808716 } } } }
```

## Module Usage Examples

```javascript
const { Nodetool } = require('cassandra-nodetool');

Nodetool({ host: '127.0.0.1', port: 7199, username: 'user', password: 'pass' })
    .status({ resolveIp: true })
    .then( ringStatus => console.log(ringStatus))
    .catch( err => console.error(err));
```

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