Skip to content

Commit 8ba4241

Browse files
author
Christian Nadeau
authored
Force commonjs and added examples (#5)
1 parent 4642242 commit 8ba4241

File tree

14 files changed

+732
-3
lines changed

14 files changed

+732
-3
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.github/
22
ci/
33
coverage/
4+
examples/
45
test/
56
**/*.test.ts
67
.babelrc

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ esbuild.build({
1010
'isomorphic-fetch',
1111
'graphql-request'
1212
],
13-
format: 'esm',
13+
format: 'cjs',
1414
logLevel: "info",
1515
metafile: true,
1616
minify: true,

examples/javascript/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+

examples/javascript/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const weaviate = require("weaviate-ts-client")
2+
3+
const client = weaviate.client({
4+
scheme: "http",
5+
host: "localhost:8080",
6+
});
7+
8+
client.misc.metaGetter()
9+
.do()
10+
.then((res) => console.log(`res: ${JSON.stringify(res)}`))

examples/javascript/package-lock.json

Lines changed: 315 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/javascript/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "weaviate-js-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"dependencies": {
7+
"weaviate-ts-client": "latest"
8+
},
9+
"scripts": {
10+
"start": "node index.js"
11+
},
12+
"author": "",
13+
"license": "ISC"
14+
}

examples/typescript/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

examples/typescript/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import weaviate from "weaviate-ts-client"
2+
3+
const client = weaviate.client({
4+
scheme: "http",
5+
host: "localhost:8080",
6+
});
7+
8+
client.misc.metaGetter()
9+
.do()
10+
.then((res: any) => console.log(`res: ${JSON.stringify(res)}`))

0 commit comments

Comments
 (0)