Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudflare-workers-template

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudflare-workers-template

A Cloudflare Workers template with Typescript and predefined opinionated ESLint and Prettier rules

  • 1.0.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cloudflare-workers-template

A Cloudflare Workers template with Typescript and predefined opinionated ESLint and Prettier rules.

Setup

  • Using create-cloudflare package:
yarn create cloudflare project-name https://github.com/Aynh/cloudflare-workers-template/
# or
npm init cloudflare project-name https://github.com/Aynh/cloudflare-workers-template/
  • Manually:
# Clone the repository
git clone https://github.com/Aynh/cloudflare-workers-template/ project-name --depth 1

# Follow the step below if you want to re-initialize the git repository (optional)
cd project-name
# Remove .git folder
rm -rf .git
# Initialize git
git init .

Install dependencies

yarn
# or
npm install

Available scripts

Subsitute yarn with npm run if you use npm.

# Local development
yarn dev
# Remote development
yarn preview
# Publish to cloudflare
yarn publish
# Lint
yarn lint
# Type check
yarn typecheck

Development

Follow Cloudflare's Get started guide if you haven't already.

This template leverage Wrangler2's module system to work, See here if you are not familiar with Cloudflare Worker's Module Worker format.

  • Linting

You may want to replace some (or all) ESLint rules defined at .eslintrc.cjs. You can also remove linting entirely by deleting .eslintrc.cjs and removing all ESLint-related dependency.

  • Formatting

You may also want replace Prettier rules at .prettierrc.json.

  • itty-router, nice tiny router to integrate with your worker.

Learning source

FAQs

Package last updated on 16 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc