npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@plugandtrade/elasticsearch-bootstrap

v2.2.2

Published

Bootstrap elasticsearch from file system structures and configuration files.

Readme

Elasticsearch bootstrap

Usage

Local

Install with:

npm install --save @plugandtrade/elasticsearch-bootstrap

Run with:

./node_modules/.bin/elasticsearch-bootstrap --indices ./indices.json

Or, edit your package.json to include it in your scripts, e.g.:

  // other stuff
  "scripts": {
    // other commands
    "bootstrap": "elasticsearch-bootstrap --indices ./indices.json"
  },
  // other stuff

and run it using:

npm run bootstrap -- --host 'http://localhost:9200' 

Note: the -- are needed before the options that should be passed to the script

Global

Install with:

npm install -g @plugandtrade/elasticsearch-bootstrap

Run with:

elasticsearch-bootstrap --indices ./indices.json

Options

Host

.. --host <url_to_elasticsearch>

Complete http url, e.g. http://localhost:9200. The default is http://localhost:9200.

Scripts

... --scripts <path-to-scripts>

The path must be a folder containing one file per script, the name of each file will be used as the id of the stored script.

Example:

 - ./scripts/
   - my_first_script.hbs
   - my_second_script.hbs

Supported script languages:

  • Handlebars: Use file extension .hbs

Index templates

... --index-templates <path-to-templates>

The path must be a folder containing json files where each file is an index template. If the template property is not specified in the file, {filename}-* will be used as template pattern.

Example:

 - ./index-templates/
   - my_first_template.json
   - my_second_template.json

Indices

... --indices <path-to-index-configurations>

The index configurations file must be a valid json file with the following structure:

{
  "indices": [
    {
      "name": "my_index",
      "index": "my_index-{{timestamp}}"
      "config": {}
    }
  ]
}
  • The config property is optional and must be a valid index configuration if set.
  • The index property defaults to [name]-{{timestamp}}, it must be a string and will be compiled as a handlebars template with the timestamp variable set to Date.now().
  • The name property must be unique.

The above config will create an index named my_index-{unix_timestamp}.

Move aliases

... --move-aliases <path-to-alias-configuration>

The alias configurations file must be a valid json file with the following structure:

{
  "indices": [
    {
      "name": "my_index",
      "alias": "my_alias",
      "index": "my_index-12345"
    }
  ]
}
  • The alias property defaults to [name].
  • The name property must be unique.
  • The index property is optional and will be overwritten by the actual index name created using --indices ... with the same name.

The above config will the alias my_alias to my_index-12345.

The indices configuration and aliases configuration are compatible and may be merged, e.g.:

{
  "indices": [
    {
      "name": "my_index",
      "alias": "my_alias",
      "index": "my_index-{{timestamp}}"
    }
  ]
}

Example: Indices json:

{
  "name": "my_index"
}

Aliases json:

{
  "name": "my_index"
}

will result in the index my_index-123456 and the alias my_index -> my_index-123456.

Reindex

... --reindex <path-to-reindex-configuration>

The alias configurations file must be a valid json file with the following structure:

{
  "indices": [
    {
      "name": "my_index",
      "alias": "my_alias",
      "index": "my_index-12345"
    }
  ]
}
  • The alias property defaults to [name].
  • The name property must be unique.
  • The index property is optional and will be overwritten by the actual index name created using --indices ... with the same name.

This option will reindex all document in alias to index using the reindex API.

The indices, aliases and reindex configurations are compatible and may be merged.

Seeds

... --seeds <path-to-seeds>

The path must be a folder with a seed structure. A seed structure follows this simple rule:

 - <index_name>/
   - <type_name>/
     - <document_id>.json
   - <type_name>/
     - <document_id>.json

The json files must be valid json containing the data of each document.

If the indices option is specified the index_name will be replaced by the actual index name created with the name parameter equal to index_name.