File tree Expand file tree Collapse file tree 4 files changed +48
-2
lines changed Expand file tree Collapse file tree 4 files changed +48
-2
lines changed Original file line number Diff line number Diff line change 3232 strategy :
3333 fail-fast : false
3434 matrix :
35- node-version : [18.x, 20.x, 22.x]
35+ node-version : [18.x, 20.x, 22.x, 23.x ]
3636 os : [ubuntu-latest, windows-latest, macOS-latest]
3737
3838 steps :
5757 run : |
5858 npm run test:unit
5959
60+ - name : ECMAScript module test
61+ run : |
62+ npm run test:esm
63+
6064 license :
6165 name : License check
6266 runs-on : ubuntu-latest
@@ -111,6 +115,10 @@ jobs:
111115 run : |
112116 bun run test:unit-bun
113117
118+ - name : ECMAScript module test
119+ run : |
120+ bun run test:esm
121+
114122 auto-approve :
115123 name : Auto-approve
116124 needs : [test, license]
Original file line number Diff line number Diff line change 66 "main" : " ./index.js" ,
77 "types" : " index.d.ts" ,
88 "exports" : {
9- "require" : " ./index.js"
9+ "require" : " ./index.js" ,
10+ "import" : " ./index.js" ,
11+ "types" : " ./index.d.ts"
1012 },
1113 "scripts" : {
1214 "test" : " npm run build && npm run lint && tap" ,
1315 "test:unit" : " npm run build && tap" ,
1416 "test:unit-bun" : " bun run build && bunx tap" ,
17+ "test:esm" : " npm run build && cd test/esm/ && npm install && node test-import.mjs" ,
1518 "test:coverage-100" : " npm run build && tap --coverage --100" ,
1619 "test:coverage-report" : " npm run build && tap --coverage && nyc report --reporter=text-lcov > coverage.lcov" ,
1720 "test:coverage-ui" : " npm run build && tap --coverage --coverage-report=html" ,
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " esm" ,
3+ "version" : " 1.0.0" ,
4+ "dependencies" : {
5+ "@elastic/elasticsearch" : " file:../.."
6+ }
7+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to Elasticsearch B.V. under one or more contributor
3+ * license agreements. See the NOTICE file distributed with
4+ * this work for additional information regarding copyright
5+ * ownership. Elasticsearch B.V. licenses this file to you under
6+ * the Apache License, Version 2.0 (the "License"); you may
7+ * not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
19+
20+ import { Client } from '@elastic/elasticsearch'
21+
22+ new Client ( {
23+ node : 'http://localhost:9200' ,
24+ auth : {
25+ username : 'elastic' ,
26+ password : 'changeme' ,
27+ }
28+ } )
You can’t perform that action at this time.
0 commit comments