Skip to content

Commit 023fe2e

Browse files
committed
docs: Create typescript/README.md
Release-As: 0.1.0
1 parent 617b407 commit 023fe2e

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

typescript/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# @codize/sdk
2+
3+
[![NPM Version](https://img.shields.io/npm/v/@codize/sdk)](https://www.npmjs.com/package/@codize/sdk)
4+
[![GitHub License](https://img.shields.io/github/license/codize-dev/sdk)](./LICENSE)
5+
6+
Official TypeScript SDK for the Codize API.
7+
8+
## Installation
9+
10+
```console
11+
$ npm install @codize/sdk
12+
```
13+
14+
## Usage
15+
16+
```typescript
17+
import { CodizeClient } from "@codize/sdk";
18+
19+
// Get your API key from the Codize: https://codize.dev/settings/api-keys
20+
const apiKey = "cdz_****";
21+
22+
const client = new CodizeClient({ apiKey });
23+
24+
const result = await client.sandbox.execute({
25+
language: "typescript",
26+
files: [
27+
{
28+
name: "index.ts",
29+
content: `console.log("Hello, World!");`,
30+
},
31+
],
32+
});
33+
34+
console.log(result.data);
35+
// => {
36+
// compile: {
37+
// stdout: "",
38+
// stderr: "",
39+
// output: "",
40+
// exit_code: 0,
41+
// },
42+
// run: {
43+
// stdout: "Hello, World!\n",
44+
// stderr: "",
45+
// output: "Hello, World!\n",
46+
// exit_code: 0,
47+
// },
48+
// }
49+
```
50+
51+
## License
52+
53+
[MIT](../LICENSE)

0 commit comments

Comments
 (0)