aws-elasticsearch-client
Advanced tools
Comparing version 1.2.1 to 2.0.0
27
index.js
@@ -1,3 +0,2 @@ | ||
'use strict'; | ||
const assert = require('assert'); | ||
const AWS = require('aws-sdk'); | ||
@@ -7,18 +6,16 @@ const elasticsearch = require('elasticsearch'); | ||
function createClient(options) { | ||
options = options || {}; // eslint-disable-line no-param-reassign | ||
function createClient(options = {}) { | ||
assert(typeof options === 'object', 'options must be an object'); | ||
const region = options.region || process.env.AWS_REGION || 'us-east-1'; | ||
const config = Object.assign( | ||
{}, | ||
options, | ||
{ | ||
connectionClass: httpAWSES, | ||
awsConfig: new AWS.Config({ | ||
region, | ||
credentials: options.credentials | ||
}) | ||
} | ||
); | ||
const config = { | ||
...options, | ||
connectionClass: httpAWSES, | ||
awsConfig: new AWS.Config({ | ||
region, | ||
credentials: options.credentials | ||
}) | ||
}; | ||
return new elasticsearch.Client(config); | ||
@@ -25,0 +22,0 @@ } |
The MIT License (MIT) | ||
Copyright (c) 2016-2018 Anton Bazhal | ||
Copyright (c) 2016-2019 Anton Bazhal | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
{ | ||
"name": "aws-elasticsearch-client", | ||
"version": "1.2.1", | ||
"version": "2.0.0", | ||
"description": "Tiny wrapper for elasticsearch and http-aws-es libraries with reasonable defaults that makes work with AWS Elasticsearch Service easier", | ||
@@ -19,4 +19,6 @@ "repository": { | ||
"main": "index.js", | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"preinstall": "npm prune", | ||
"lint": "eslint .", | ||
@@ -29,13 +31,23 @@ "test": "npm run lint" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Jonathon Hill", | ||
"email": "jhill9693@gmail.com" | ||
} | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"aws-sdk": "^2.138.0", | ||
"elasticsearch": "^15.1.1", | ||
"http-aws-es": "^6.0.0" | ||
}, | ||
"peerDependencies": { | ||
"aws-sdk": "^2.509.0", | ||
"elasticsearch": "^15.5.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.6.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-plugin-import": "^2.14.0" | ||
"aws-sdk": "^2.509.0", | ||
"elasticsearch": "^15.5.0", | ||
"eslint": "^6.1.0", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-plugin-import": "^2.18.2" | ||
} | ||
} |
@@ -13,3 +13,3 @@ # aws-elasticsearch-client | ||
```bash | ||
$ npm install aws-elasticsearch-client | ||
$ npm install --save aws-elasticsearch-client elasticsearch aws-sdk | ||
``` | ||
@@ -50,3 +50,3 @@ | ||
Copyright (c) 2016-2018 Anton Bazhal | ||
Copyright (c) 2016-2019 Anton Bazhal | ||
@@ -53,0 +53,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
75305
0
5
1817
- Removedaws-sdk@^2.138.0
- Removedelasticsearch@^15.1.1