Wrap a function with bun-livereload to automatically reload any imports inside the function the next time it is called

Overview

bun-livereload

Wrap a function with bun-livereload to automatically reload any imports inside the function the next time it is called.

import liveReload from "bun-livereload";

export default {
  fetch: liveReload(async function (req: Request) {
    const { render } = await import("./my-page.js");
    return new Response(render(req));
  }),
};

Install

bun add bun-livereload
You might also like...

Tracer for module requires/imports to optimize coldstarts in serverless

treq treq is a library to automatically trace requires/imports in your serverless applications and gives you insights about the most expensive modules

Aug 16, 2022

An imports transform unplugin.

unplugin-transform-imports An imports transform unplugin based on babel inspired by babel-plugin-transform-imports. What unplugin-transform-imports Do

Nov 29, 2022

Sort imports by path - VS Code extension

Import sort by absolute path The sorting algorithm will group each item in the array and sort (alphabetically) its children that starts with the path

Feb 2, 2022

Patches the AssemblyScript compiler to utilize WASI imports instead of Web APIs.

Patches the AssemblyScript compiler to utilize WASI imports instead of Web APIs.

WASI shim for AssemblyScript Patches the AssemblyScript compiler to utilize WASI imports instead of Web APIs. Note that this shim also serves a higher

Dec 23, 2022

A next-gen web framework made on top of bun

Eviate JS (WIP) Next-generation web framework to build powerful apps Features Simple: No more req or res. It's all ctx (context) and plain objects! Fa

Oct 30, 2022

CLI Progress Bar implemented in NodeJS to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code

CLI Progress Bar implemented in NodeJS to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code

NodeJS-ProgressBar CLI Progress Bar for NodeJS and JavaScript to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code D

Nov 14, 2022

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time. Dropdown, navigation bu

Nov 25, 2022

Refresh - Simple browser reload on file change middleware for your Deno web applications.

refresh Simple browser reload on file change middleware for your Deno web applications. Usage To use refresh middleware, just add a few extra lines to

Dec 19, 2022

Live Reload Examples

Live Reload Examples Examples of live reloading code to create a fast feedback loop. Examples in this code repo accompany a soon to be published blog

Sep 29, 2022
Comments
  • Bug | typscript linting not able to detect bun-livereload when tsconfig module resolution set to

    Bug | typscript linting not able to detect bun-livereload when tsconfig module resolution set to "nodenext"

    Replication Steps

    • create a new bun project using bun init
    • make sure the tsconfig.json has "moduleResolution": "nodenext" but I think this is the default for a new bun init project (from no template)
    • open index.ts and add import liveReload from "bun-livereload";
    • expect it to import just fine
    • instead you get image
    • go to tsconfig.json and change moduleResolution to node
    • reload window
    • expect import error to cease

    Detail

    • This is done in wsl 2.0 ubuntu image on bun 0.3.0 in the vscode editor. I can provide version for all these if you can't readily reproduce

    Work Around

    Go to tsconfig.json and set "moduleResolution" to "node"

    opened by i-Welch 0
Owner
Jarred Sumner
Jarred Sumner
Bun-Bakery is a web framework for Bun. It uses a file based router in style like svelte-kit. No need to define routes during runtime.

Bun Bakery Bun-Bakery is a web framework for Bun. It uses a file based router in style like svelte-kit. No need to define routes during runtime. Quick

Dennis Dudek 44 Dec 6, 2022
Fast, Bun-powered, and Bun-only(for now) Web API framework with full Typescript support.

Zarf Fast, Bun-powered, and Bun-only(for now) Web API framework with full Typescript support. Quickstart Starting with Zarf is as simple as instantiat

Zarf Framework 65 Dec 28, 2022
Automatically reload the frontend when content changes are saved in the panel.

Kirby Reload On Save This plugin for Kirby 3 automatically reloads the frontend when content changes are saved in the panel. It uses the Broadcast Cha

JUNO 21 Jun 7, 2023
Inside-out promise; lets you call resolve and reject from outside the Promise constructor function.

Inside-out promise; lets you call resolve and reject from outside the Promise constructor function.

Lily Scott 3 Feb 28, 2022
Multithread emulator. The wrun allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file

wrun This lib allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file. This means tha

Felippe Regazio 9 Nov 5, 2022
Nest multiple blocks inside lists of any kind of list (ordered, unordered, no marker, etc), or do away with list markers and use it like a repeater!

Nest multiple blocks inside lists of any kind of list (ordered, unordered, no marker, etc), or do away with list markers and use it like a repeater!

Rani 15 Dec 26, 2022
Wrap selected text in custom tags with shortcuts.

Obsidian Wrap With Shortcuts Wrap the selected text in customized tags with shortcuts. Underline is provided with Ctrl-u(Cmd-u) as default wrappers. P

Manic Chuang 24 Dec 28, 2022
Wrap zod validation errors in user-friendly readable messages

zod-validation-error Wrap zod validation errors in user-friendly readable messages. Features User-friendly readable messages, configurable via options

Causaly 70 Dec 23, 2022
Sheetzapper imports your account value accross Zapper.fi supported wallets and dapps into a Google Sheet

Overview Sheetzapper imports your account value accross Zapper.fi supported wallets and dapps into a Google Sheet. This allows you to chart your net w

null 4 Nov 27, 2022
Combine type and value imports using Typescript 4.5 type modifier syntax

type-import-codemod Combines your type and value imports together into a single statement, using Typescript 4.5's type modifier syntax. Before: import

Ian VanSchooten 4 Sep 29, 2022