feat: Modernize package with ES modules and improve error handling
- Update to ES modules syntax throughout the codebase - Add fileURLToPath and dirname imports to handle __dirname in ES modules - Upgrade Anthropic SDK from 0.10.0 to 0.39.0 - Fix JSON parsing to handle responses wrapped in Markdown code blocks - Improve documentation with clearer installation instructions - Add important notes about ES modules and SDK requirements - Update environment examples with API key format and model recommendations - Include index.js in package files list - Bump version to 1.0.2
This commit is contained in:
@@ -5,9 +5,14 @@
|
||||
* It ensures all necessary files are included and properly configured.
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Define colors for console output
|
||||
const COLORS = {
|
||||
|
||||
Reference in New Issue
Block a user