Skip to content

Commit

Permalink
docs(playground): improve Node.js ESM example README formatting
Browse files Browse the repository at this point in the history
- Added line breaks in README.md for better readability
- Removed trailing whitespace in package.json
- Enhanced code block and section formatting in README
  • Loading branch information
anthonydevs17 committed Feb 20, 2025
1 parent 2953cb5 commit dcac955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion playground/nodejs-esm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ nodejs-esm/
## Getting Started

1. Install dependencies:

```bash
npm install
```

2. Configure your environment:

- Copy `.env.example` to `.env` (if not already done)
- Add your OpenAI API key to `.env`:
```
OPENAI_API_KEY=your-api-key-here
```
3. Run the examples:
```bash
# Run ESM version
npm start
Expand All @@ -50,11 +53,13 @@ nodejs-esm/
## Code Examples

### ESM Version (index.js)

```javascript
import { Agent, Task, Team } from 'kaibanjs';
```

### CommonJS Version (index.cjs)

```javascript
const { Agent, Task, Team } = require('kaibanjs');
```
Expand All @@ -63,4 +68,4 @@ const { Agent, Task, Team } = require('kaibanjs');

- This example demonstrates that KaibanJS works in Node.js environments without requiring React as a dependency
- The example uses zustand's core functionality without React-specific features
- Both ESM and CommonJS versions implement the same functionality to showcase module system compatibility
- Both ESM and CommonJS versions implement the same functionality to showcase module system compatibility
2 changes: 1 addition & 1 deletion playground/nodejs-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"kaibanjs": "^0.14.0",
"dotenv": "^16.4.5"
}
}
}

0 comments on commit dcac955

Please sign in to comment.