Installation
Learn how to install Edge-Utils and integrate it into your edge computing project.Package Installation
npm
yarn
pnpm
Deno
Platform-Specific Setup
Cloudflare Workers
- Install Wrangler CLI (if not already installed):
- Create a new project:
- Install Edge-Utils:
- Configure wrangler.toml:
- Example usage in src/index.js:
Vercel Edge Functions
- Install Vercel CLI (if not already installed):
- Create a new project:
- Install Edge-Utils:
- Create an edge function in api/graphql.js:
- Set environment variables:
Deno Deploy
- Install Deno CLI (if not already installed):
- Create a new project:
- Create deno.json:
- Create main.ts:
- Deploy to Deno Deploy:
TypeScript Support
Edge-Utils comes with full TypeScript support. If you’re using TypeScript, the types will be automatically available.TypeScript Configuration
For optimal TypeScript experience, ensure yourtsconfig.json
includes:
Bundle Size Optimization
Edge-Utils is designed to be lightweight. You can import only the utilities you need:Environment Variables
Set up the following environment variables for your deployment:Required
GRAPHQL_ENDPOINT
- Your GraphQL API endpointJWT_SECRET
- Secret key for JWT token signing
Optional
REDIS_URL
- Redis URL for distributed cachingDATABASE_URL
- Database connection stringAPI_KEYS
- Comma-separated list of API keys
Testing Your Installation
Create a simple test file to verify your installation:Troubleshooting
Common Issues
Module not found error- Ensure you’ve installed the package correctly
- Check that your import paths are correct
- For Deno, verify the import URL in deno.json
- Update your TypeScript version to 4.5+
- Check your tsconfig.json configuration
- Ensure you’re importing types correctly
- Verify environment variables are set
- Check network connectivity to external APIs
- Ensure your edge platform supports all Web APIs used
Getting Help
Next Steps
Now that you have Edge-Utils installed, check out:- Quick Start - Basic usage examples
- Core Utilities - Detailed guides for each utility
- Examples - More comprehensive examples