Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dts-els

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dts-els

A simple command line tool that generate TypeScript definition from ElasticSearch mappings

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CircleCI

dts-els

A simple command line tool that generates TypeScript definition from ElasticSearch mappings.

Installation

npm install dts-els

Usage

usage: dts-els [--array ARRAY_PROPERTIES] [--maybe-array MAYBE_ARRAY_PROPERTIES] INTERFACE_NAME

ARRAY_PROPERTIES: Cast a property to an array of the derived type. Multiple properties are separated by comma.
MAYBE_ARRAY_PROPERTIES: Cast a property to the dervided type or an array of the type.
INTERFACE_NAME: Interface name of the definition

Example

Assume you have jq installed:

curl -s https://raw.githubusercontent.com/elastic/examples/master/Common%20Data%20Formats/twitter/twitter_template.json | jq .mappings.tweets.properties | npx dts-els --array=entities ITweet

will print out:

export interface ITweet {

    // @timestamp: date
    '@timestamp': number;

    // text: text
    'text': string;

    // user: object
    'user': {
        // description: text
        'description': string;
    };

    // coordinates: object
    'coordinates': {
        // coordinates: geo_point
        'coordinates': {
            // lon: float
            'lon': number;
            // lat: float
            'lat': number;
        };
    };

    // entities: object
    'entities': Array<{
        // hashtags: object
        'hashtags': {
            // text: text
            'text': string;
        };
    }>;

    // retweeted_status: object
    'retweeted_status': {
        // text: text
        'text': string;
    };
}

License

MIT. See License file.

FAQs

Package last updated on 08 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc