New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hattip/bundler-cloudflare-workers

Package Overview
Dependencies
Maintainers
0
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hattip/bundler-cloudflare-workers

Cloudflare Workers bundler for Hattip

  • 0.0.49
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
decreased by-22.45%
Maintainers
0
Weekly downloads
 
Created
Source

@hattip/bundler-cloudflare-workers

Hattip bundler for Cloudflare Workers. It uses esbuild behind the scenes.

CLI

hattip-cloudflare-workers [...options] <input> <output>

Bundle the Hattip app in <input> into <output> as a Clourflare Workers module.

Options:
  -e, --entry    Interpret <input> as a Cloudflare Workers module entry instead of a Hattip handler entry
  -h, --help     Display this message
  -v, --version  Display version number

The input can be either a module that default exports a Hattip handler entry or a Cloudflare Workers module similar to the following:

import cloudflareWorkersAdapter from "@hattip/adapter-cloudflare-workers";
import handler from "./handler.js";

export default {
  fetch: cloudflareWorkersAdapter(handler),
};

The output is a Clourflare Workers bundle that can be deployed with wrangler or tested with wrangler dev.

JavaScript API

import bundler from "@hattip/bundler-cloudflare-workers";

// You can specify either `cfwEntry` or `handlerEntry` but not both.
bundler({
  // cfwEntry: "entry-cloudflare-workers.js",
  handlerEntry: "./handler.js",
  output: "./cfw-bundle.js",
}).then(() => {
  console.log("Bundle complete");
});

The bundling function also accepts a second argument, a callback that is called with an esbuild options object for customizing the build.

FAQs

Package last updated on 02 Nov 2024

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