@codize/sdk 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codize/sdk",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Official TypeScript SDK for the Codize API",
5
5
  "homepage": "https://github.com/codize-dev/sdk",
6
6
  "repository": {