Code Monkey home page Code Monkey logo

elastic-ts's Introduction

✨ elastic-ts

Build Status Status: Alpha npm npm Powered by TypeScript

A TypeScript module for working with Elasticsearch.

Goals

  • Provide TypeScript types for Elasticsearch queries
  • Provide a typed query body builder with an immutable API

Non-goals

  • Replace the official Elasticsearch API client

Requirements

  • TypeScript 2.8 - this project uses conditional types which were introduced in TypeScript 2.8

Installation

yarn add elastic-ts

Usage

Types

import {SearchBody} from 'elastic-ts'

const body: SearchBody = {
  query: {
    match_all: {},
  },
}

Builder

import {esBuilder} from 'elastic-ts'

const body = esBuilder()
  .query('match_all', {})
  .filter('terms', 'field', ['one', 'two'])
  .build()

Credits

The query builder API is heavily inspired by bodybuilder, although there are subtle API and behavioral differences.

Contributing

You can build the project by running yarn build, or can be continuously built with yarn watch. Tests are executed by running yarn test.

NOTE: the tests run against the built output files, so you will need to run yarn build or yarn watch before running yarn test.

License

The MIT license. See LICENSE.

elastic-ts's People

Contributors

jacobwgillespie avatar dependabot[bot] avatar brunozoric avatar stevengbrown avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.