Home
Softono

Cloudflare Typescript Worker Template

Open source Apache-2.0 TypeScript
26
Stars
4
Forks
0
Issues
2
Watchers
4 years
Last Commit

 About Cloudflare Typescript Worker Template

Template for a tested linted formatted strict TypeScript Cloudflare Worker built with webpack

Platforms

Web Self-hosted Cloud

Languages

TypeScript

Links

Need Help Installing Cloudflare Typescript Worker Template?

We provide expert installation service for this software. Our team will install, configure, and secure Cloudflare Typescript Worker Template on your server. plans start at just $30.

Cloudflare Typescript Worker Template

View on GitHub

Starter Template for a TypeScript Cloudflare Worker

A preconfigured starter template for building a Tslint strictly linted/formatted, Jest tested, Webpack built, TypeScript Cloudflare Worker. Uses the NPM packages provided by the udacity/cloudflare-typescript-workers project.

Getting Started

Use this Github Repository Template or fork the repository to create a new repository.

Visual Studio Code or any other IDE with TypeScript IntelliSense or similar support is recommended.

Usage

# Setup node_modules
npm i
# Run linter
npm run lint
# Run linter and fix where possible
npm run lint-fix
# Run tests
npm test
# Build development readable worker js file
npm run build-dev
# Build production minified worker js file
npm run build

The build will generate a dist/index.js which you can deploy to Cloudflare.

Files and Directories

  • src/ - Stores index.ts for the worker and any additional workers.
  • test/ - Stores index.test.ts to test the worker.
  • package.json - The npm configuration contains common tasks such as build and test.
  • jest.config.js - A TypeScript configuration for jest.
  • tsconfig.json - A strict TypeScript configuration for building Workers for Cloudflare.
  • tslint.json - A detailed tslint configuration with exceptions for common Worker needs.
  • webpack.config.js - A simple webpack configuration to agreggate dependencies and build a worker.

License

Licensed under the Apache License, Version 2.0.

© 2019 Udacity, Inc.