# esbootstrap

> Helper to bootstrap an index and load fixtures to an elasticsearch instance

Latest version **1.0.6** (published 2015-02-01) · MIT license · 0 weekly downloads

## Install

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

## 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.0.6 |
| Published | 2015-02-01 |
| First published | 2015-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Filippo De Santis |
| Maintainers | odino, filippo.desantis, unlucio |
| Keywords | elasticsearch, test, fixtures, bootstrap |

## Links

- npm: https://www.npmjs.com/package/esbootstrap
- Repository: https://github.com/namshi/esbootstrap
- Issues: https://github.com/namshi/esbootstrap/issues
- npm.io page: https://npm.io/package/esbootstrap

## Dependencies (1)

- [elasticsearch](https://npm.io/package/elasticsearch.md) >=3.0.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2015-02-01
- 1.0.5 — 2015-01-28
- 1.0.4 — 2015-01-28
- 1.0.3 — 2015-01-28
- 1.0.2 — 2015-01-28
- 1.0.1 — 2015-01-28
- 1.0.0 — 2015-01-28

## README

# esbootstrap

esboostrap will bootstrap, map and load fixtures for an elasticsearch index.

## Installation

Add esboostrap in devDependencies 

```bash
npm install esbootstrap --save-dev
```

## Usage

```javascript
var esbootstrap = require('esbootstrap');
var fixtures = require('./path/tofixtures.json');
var options = {
    elasticsearch: {
        host: ...
        log: ...
        requestTimeout: ...
        keepAlive: ..
    },
    indexName:...,
    createRequestBody: {...}, // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create
    mappingRequestBody: {...}, // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-indices-putmapping
    fixtures: fixtures // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk 
};

esbootstrap.bootstrap(options, function() {
    //....
});
```

Or if you already have an elasticsearch instance up
and running and want to only load some data:

```javascript
var fixtures = require('./path/tofixtures.json');
var options = {
    elasticsearch: {
        host: ...
        log: ...
        requestTimeout: ...
        keepAlive: ..
    },
    fixtures: fixtures // @see http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk 
};

esbootstrap.loadFixtures(options, function() {
    //....
});
```

## Tests

![b****-please](http://galeri2.uludagsozluk.com/342/bitch-please_459292.jpg)

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