# cassandra-installer

> [![Coverage Status](https://david-dm.org/fmatar/cassandra-installer.svg)](https://david-dm.org/fmatar/cassandra-installer) [![Dependencies](https://coveralls.io/repos/fmatar/cassandra-installer/badge.svg?branch=master)](https://coveralls.io/fmatar/cassand

Latest version **1.1.2** (published 2016-08-09) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2016-08-09 |
| First published | 2016-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | fmatar |

## Links

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

## Dependencies (5)

- [tar-fs](https://npm.io/package/tar-fs.md) ^1.13.0
- [cheerio](https://npm.io/package/cheerio.md) ^0.20.0
- [request](https://npm.io/package/request.md) ^2.74.0
- [winston](https://npm.io/package/winston.md) ^2.2.0
- [cassandra-driver](https://npm.io/package/cassandra-driver.md) ^3.0.2

## Recent versions

- 1.1.2 (latest) — 2016-08-09
- 1.1.1 — 2016-07-13
- 1.1.0 — 2016-05-24
- 1.0.2 — 2016-05-23
- 1.0.0 — 2016-05-21
- 0.1.4 — 2016-05-16
- 0.1.3 — 2016-05-16
- 0.1.2 — 2016-05-16
- 0.1.1 — 2016-05-16
- 0.1.0 — 2016-05-13
- 0.0.4 — 2016-05-11
- 0.0.3 — 2016-05-10
- 0.0.2 — 2016-05-05
- 0.0.1 — 2016-04-04

## README

# Cassandra Installer

[![Coverage Status](https://david-dm.org/fmatar/cassandra-installer.svg)](https://david-dm.org/fmatar/cassandra-installer)
[![Dependencies](https://coveralls.io/repos/fmatar/cassandra-installer/badge.svg?branch=master)](https://coveralls.io/fmatar/cassandra-installer)

This package is a utility that provides the ability to use Cassandra in an embedded way for your node.js applications. The process works as follows:

* Select the package version of cassandra 
* Download Cassandra (It will fetch from the nearest mirror)
* Install cassandra
* Start Cassandra
* Stop Cassandra
* Configure your logger instance for the module

## Example Usage
```javascript
'use strict';    
    
const CassandraInstaller = require('cassandra-installer'),
      winston            = require('winston');
    
/* Create the logging levels, if none provided it will revert to the default console logger */

var transports = [
  new (winston.transports.Console)(),
  new (winston.transports.File)({ filename: '/tmp/cassandra-installer.log' })
];

var options = {
  destination : '/tmp',
  version : '3.5',
  dbName : 'test_db',
  transports : transports
};

/* Create a new installer that will download cassandra 3.4 in /tmp */ 
var installer = new CassandraInstaller(options);

    
/* Download cassandra */
installer.download((err, data) => {
  /* Install cassandra */
  installer.install((err, data) => {
  
    /* Start cassandra */
    installer.start();
    
    /* Create the keyspace that was defined in option */
    installer.createKeyspace(err =>{
      
      /* Drop the db */
      installer.dropKeyspace(err => {
      
        /* Stop cassandra */
        installer.stop();
        
        /*Cleanup */
              setTimeout(function() { //allow 10 seconds for cassandra to shutdown gracefully
                installer.uninstall(err => {
                  if(err) console.log(err);
                });
              }, 10000);
      });
    );
  });
});
```

*Note* : Make sure you have the Java runtime 1.8.x installed so that Cassandra runs. 

This module works on MacOS X and all flavors of *nix

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