跳到正文

Workers SDK

热门趋势维护中
cloudflare/workers-sdk

Cloudflare Workers 官方 SDK,提供在 Cloudflare 全球网络上开发、测试和部署无服务器应用的完整工具链。

在 GitHub 查看
星标
4312
Fork
1333
关注
4312
未关闭 Issue
425

该介绍目前仅提供英文版本。

Workers SDK

Workers SDK (formerly Wrangler) is the official command-line tool for Cloudflare Workers, enabling developers to build, test, and deploy serverless applications on Cloudflare’s global network.

Core Features

  • Project Management: Create, develop, and deploy Workers projects
  • Local Development: Test Workers locally with miniflare integration
  • Pages Integration: Deploy static sites and full-stack applications
  • D1 Database: Manage D1 databases directly from the CLI
  • R2 Storage: Handle R2 storage buckets and objects
  • KV Support: Interact with Workers KV namespaces
  • Durable Objects: Deploy and manage Durable Objects
  • Custom Builds: Support for custom build processes and configurations
  • TypeScript Support: First-class TypeScript development experience

Quick Start

  1. Installation:

    npm install -g wrangler
  2. Authentication:

    wrangler login
  3. Create a Project:

    wrangler init my-worker
    cd my-worker
  4. Development:

    wrangler dev
  5. Deployment:

    wrangler deploy

Key Components

  • Wrangler CLI: Command-line interface for Workers
  • Miniflare: Local development environment
  • Dev Tools: Built-in debugging and testing tools
  • Configuration: Flexible project configuration
  • Templates: Project templates for quick starts
  • Plugin System: Extensible plugin architecture

Use Cases

  • Building serverless applications
  • Deploying static websites
  • Creating API endpoints
  • Managing Workers KV data
  • Handling R2 storage operations
  • Developing full-stack applications
  • Testing Workers locally
  • Managing deployment environments

Advanced Features

  • Environment Variables: Secure configuration management
  • Custom Domains: Domain management and SSL
  • Secret Management: Secure secrets handling
  • Multi-environment Support: Dev, staging, and production environments
  • Tailored Builds: Custom build configurations
  • Asset Management: Static asset handling
  • Monitoring: Built-in logging and debugging

Community and Support

License

This project is licensed under the Apache License 2.0.

按共同分类和标签排序的同类开源项目。

全部 SDK 项目 →