Skip to content

Commit 0ede241

Browse files
authored
Merge pull request #229 from javascriptdata/readme-updates-2
more updates to readme
2 parents 8e419c6 + f20e5c4 commit 0ede241

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

README.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Documentation site: [www.scikitjs.org](https://www.scikitjs.org)
2121
For use with modern bundlers in a frontend application, simply
2222

2323
```bash
24-
npm i @tensorflow/tfjs
25-
npm i scikitjs
24+
npm i @tensorflow/tfjs scikitjs
2625
```
2726

2827
We depend on the tensorflow library in order to make our calculations fast, but we don't ship it in our bundle.
@@ -40,16 +39,24 @@ This allows us to build a library that can be used in Deno, Node, and the browse
4039
For Node.js users who wish to bind to the Tensorflow C++ library, simply import the tensorflow C++ version, and use that as the tf library
4140

4241
```bash
43-
npm i @tensorflow/tfjs-node
44-
npm i scikitjs
42+
npm i @tensorflow/tfjs-node scikitjs
4543
```
4644

45+
```js
46+
const tf = require('@tensorflow/tfjs-node')
47+
const sk = require('scikitjs')
48+
sk.setBackend(tf)
49+
```
50+
51+
Note: If you have ESM enabled (by setting type="module" in your package.json), then you can consume this libary with import / export, like in the following code block.
52+
4753
```js
4854
import * as tf from '@tensorflow/tfjs-node'
4955
import * as sk from 'scikitjs'
5056
sk.setBackend(tf)
5157
```
5258

59+
5360
### Script src
5461

5562
For those that wish to use script src tags, simply
@@ -68,7 +75,7 @@ For those that wish to use script src tags, simply
6875
## Simple Example
6976

7077
```js
71-
import * as tf from '@tensorflow/tfjs-node'
78+
import * as tf from '@tensorflow/tfjs'
7279
import { setBackend, LinearRegression } from 'scikitjs'
7380
setBackend(tf)
7481

@@ -128,7 +135,7 @@ Turns into
128135
#### JavaScript
129136

130137
```js
131-
import * as tf from '@tensorflow/tfjs-node'
138+
import * as tf from '@tensorflow/tfjs'
132139
import { setBackend, LinearRegression } from 'scikitjs'
133140
setBackend(tf)
134141

@@ -160,7 +167,7 @@ Turns into
160167
#### JavaScript
161168

162169
```js
163-
import * as tf from '@tensorflow/tfjs-node'
170+
import * as tf from '@tensorflow/tfjs'
164171
import { setBackend, LinearRegression } from 'scikitjs'
165172
setBackend(tf)
166173

@@ -197,7 +204,7 @@ Turns into
197204
#### JavaScript
198205

199206
```js
200-
import * as tf from '@tensorflow/tfjs-node'
207+
import * as tf from '@tensorflow/tfjs'
201208
import { setBackend, LogisticRegression } from 'scikitjs'
202209
setBackend(tf)
203210

0 commit comments

Comments
 (0)