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

@hattip/bundler-deno

Package Overview
Dependencies
Maintainers
0
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hattip/bundler-deno

Deno bundler for Hattip

  • 0.0.49
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@hattip/bundler-deno

Hattip bundler for Deno. It uses esbuild behind the scenes.

CLI

hattip-deno <input> <output>

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

Options:
  -h, --help     Display this message
  -v, --version  Display version number

The input should be a Deno module similar to the following:

import { createRequestHandler } from "@hattip/adapter-deno";
import handler from "./handler.js";

Deno.serve(createRequestHandler(handler), { port: 3000 });

If you want serve static files too, you can use the serveDir function. Assuming your static files are in the public directory, you can use the following:

import { serve, serveDir, createRequestHandler } from "@hattip/adapter-deno";
import hattipHandler from "./handler.js";

const handler = createRequestHandler(hattipHandler);

serve(
  async (request, connInfo) => {
    const staticResponse = await serveDir(request, { fsRoot: "./public" });

    if (staticResponse.status !== 404) {
      return staticResponse;
    }

    return handler(request, connInfo);
  },
  {
    port: 3000,
  },
);

The output is a Deno module that can be run with deno run or deployed to Deno Deploy.

JavaScript API

🚧 TODO 🚧

Refer to the TypeScript for the time being.

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