File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 1
1
## setup node project
2
- npm init es6 -y && npm install langchain openai dotenv @types/node typescript ts-node
2
+ 1 . install dependencies
3
+ ``` npm init es6 -y && npm install langchain openai dotenv @types/node
4
+ ```
5
+ 2 . setup node project
6
+ ```
7
+ ```
8
+ typescript ts-node
9
+ ```
10
+ ```
3
11
npx tsc --init --rootDir src --outDir ./dist --esModuleInterop --lib ES2020 --target ES2020 --module nodenext --noImplicitAny true
12
+ ```
13
+
14
+ 3. Update Package.json
4
15
5
- ### add to package.json
6
16
```
7
17
"scripts": {
8
18
"build": "tsc",
9
19
"start": "node ./dist/app.js",
10
20
"dev": "ts-node --esm ./src/app.ts"
11
21
},
12
22
```
13
- ### Create an app.ts source file in the src folder. Add code to it to display a test string.
23
+
24
+ 4. Create app.ts in the src folder.
25
+ ```
14
26
mkdir src
15
27
echo "console.log('Welcome to the LangChain.js tutorial by LangChainers.')" > src/app.ts
28
+ ```
16
29
17
- ### boot up
30
+ 5. boot up
31
+ ```
18
32
npm run build
19
33
npm run start
34
+ ```
20
35
21
36
## blog post tutorial https://langchainers.hashnode.dev/getting-started-with-langchainjs
22
37
You can’t perform that action at this time.
0 commit comments