Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd2aa41

Browse files
authored
Added webpack demo (#969)
1 parentfd9a7d3 commitbd2aa41

File tree

7 files changed

+1517
-3
lines changed

7 files changed

+1517
-3
lines changed

‎pgml-sdks/pgml/javascript/examples/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#Webpack Demo
2+
3+
The JavaScript SDK utilizes native node modules as our SDK is written in Rust. To get it working with webpack, we need a loader that is designed to work with native node modules. In this case, we have opted to use the[node-loader](https://github.com/webpack-contrib/node-loader) module. See[webpack.config.js](./webpack.config.js) for how we configured it.
4+
5+
##Prerequisites
6+
7+
Before running, first install dependencies and set the DATABASE_URL environment variable:
8+
```
9+
npm i
10+
export DATABASE_URL={YOUR DATABASE URL}
11+
```
12+
13+
Optionally, configure a .env file containing a DATABASE_URL variable.
14+
15+
##Running the Example
16+
17+
The example utilizes the Builtins class to perform text classification. After following the[Prerequisites](#/Prerequisites) run the following code:
18+
```
19+
npm run build
20+
node dist/index.js "I love PostgresML"
21+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp