-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #341 from Peefy/nodejs-api-doc
docs: add nodejs API documents
- Loading branch information
Showing
6 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Node.js API | ||
|
||
## Installation | ||
|
||
```shell | ||
npm install kcl-lib | ||
``` | ||
|
||
## Quick Start | ||
|
||
```typescript | ||
import { execProgram, ExecProgramArgs } from "kcl-lib"; | ||
|
||
function main() { | ||
const result = execProgram(new ExecProgramArgs(["path/to/kcl.k"])); | ||
console.log(result.yamlResult); | ||
} | ||
|
||
main(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api/nodejs-api.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Node.js API | ||
|
||
## 添加依赖 | ||
|
||
```shell | ||
npm install kcl-lib | ||
``` | ||
|
||
## 快速开始 | ||
|
||
```typescript | ||
import { execProgram, ExecProgramArgs } from "kcl-lib"; | ||
|
||
function main() { | ||
const result = execProgram(new ExecProgramArgs(["path/to/kcl.k"])); | ||
console.log(result.yamlResult); | ||
} | ||
|
||
main(); | ||
``` |
24 changes: 24 additions & 0 deletions
24
...CN/docusaurus-plugin-content-docs/version-0.8/reference/xlang-api/nodejs-api.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Node.js API | ||
|
||
## 添加依赖 | ||
|
||
```shell | ||
npm install kcl-lib | ||
``` | ||
|
||
## 快速开始 | ||
|
||
```typescript | ||
import { execProgram, ExecProgramArgs } from "kcl-lib"; | ||
|
||
function main() { | ||
const result = execProgram(new ExecProgramArgs(["path/to/kcl.k"])); | ||
console.log(result.yamlResult); | ||
} | ||
|
||
main(); | ||
``` |
24 changes: 24 additions & 0 deletions
24
versioned_docs/version-0.8/reference/xlang-api/nodejs-api.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# Node.js API | ||
|
||
## Installation | ||
|
||
```shell | ||
npm install kcl-lib | ||
``` | ||
|
||
## Quick Start | ||
|
||
```typescript | ||
import { execProgram, ExecProgramArgs } from "kcl-lib"; | ||
|
||
function main() { | ||
const result = execProgram(new ExecProgramArgs(["path/to/kcl.k"])); | ||
console.log(result.yamlResult); | ||
} | ||
|
||
main(); | ||
``` |