A quick example demonstrating how to use elasticsearch.js, Bluebird, and AWS Elasticsearch with TypeScript.
You'll need to install a few dependencies and types:
npm install --save @types/elasticsearch @types/http-aws-es elasticsearch http-aws-es bluebirdIf you're using AWS Elasticsearch, provide an ES_TYPE environment variable set to aws, as well as values for AWS_ACCESS_KEY, AWS_SECRET_KEY, and AWS_REGION. (I make this configurable so it's easy to point applications at a local ES instance when developing/testing locally, and at AWS when deployed to production)