https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-libraries
  • itty-router-openapi
    g

    Gabry

    11/17/2022, 6:27 AM
    Hey there! I'm from the Radar team in Cloudflare, and we've just released an internal tool we built during Radar 2.0 development that adds OpenAPI schema generation and validation to the popular itty-router package This new package is a drop-in replacement for existing applications that already use itty-router Feel free to give feedback in this thread or in the #1035553707116478495 channel https://github.com/cloudflare/itty-router-openapi
    t
    s
    +4
    • 7
    • 21
  • WASI-ready Argon2
    l

    lufs

    11/21/2022, 7:31 AM
    Simple arguments-based Argon2 that you can use with WASI on Workers (.wasm and example included). It wraps the
    argon2
    Rust crate and provides hash & verify functions. https://github.com/auth70/argon2-wasi
    j
    • 2
    • 2
  • Kuiper beta
    s

    sizumita

    11/22/2022, 5:34 PM
    👋Hi! I have been working on Kuiper - A HTTP Client for Cloudflare workers that is a wrapper of fetch functions. https://github.com/machikado-network/kuiper We can fetch HTTP requests with simple expressions:
    Copy code
    ts
    const response = await kuiper.post("https://httpbin.org/post", {key: "value"})
    And it supports Service Bindings:
    Copy code
    ts
    const response = await kuiper(env.API).post('https://api/users', {...})
    Since this library is now working and has some issues, I am glad you to using it and posting some issues!
    • 1
    • 1
  • Model 1
    j

    jclatro

    11/23/2022, 2:07 PM
    Hey! you used to be a Rails dev and nowadays you feel nostalgic and miss ruby just like me? I been working on a Model for Cloudflare D1, just like ActiveRecord but with validations outside the model. I been testing it for the last 4 months in some personal projects and now i would like to share it to have some feedback before i continue working on a cli to improve the dx. Features: - Basic CRUD Model. - UUID by default. - Timestamps for created_at and updated_at. - Validations by Joi. - Raw SQL queries. Read more at github: https://github.com/hacksur/model-one Any insights and feedback are welcome
  • Pico
    y

    yusukebe

    11/24/2022, 11:53 AM
    Hi! I've made another web framework for Cloudflare Workers named "Pico". It also works on Deno. https://github.com/yusukebe/pico Pico is ultra-tiny! It is only 1kB in minified. In most cases, it's better to use Hono, but if you want to return just the Response object or really want to reduce bundle size, you can use Pico.
    n
    m
    • 3
    • 10
  • Drizzle ORM for D1
    a

    alexblokh

    11/26/2022, 11:16 AM
    Hey! Over the past 18 months we've being building best in class TypeScript ORM We finally launched D1 SQLite package so you finally give it a shot! NPM - https://www.npmjs.com/package/drizzle-orm Docs - https://driz.li/sqlite-docs Example project - https://driz.li/d1-ex if you have any questions - you can DM me here, or on twitter - https://twitter.com/_alexblokh or just ask questions below Our SQLite implementation is faster than better-sqlite3 driver - https://twitter.com/_alexblokh/status/1593593415907909634 0 dependencies and 6.8kb package size - https://twitter.com/_alexblokh/status/1594735880417472512 We also have a tool for automatic migrations generation, only one on the market - https://www.npmjs.com/package/drizzle-kit
    e
    b
    +7
    • 10
    • 63
  • R2-explorer
    g

    Gabry

    11/28/2022, 8:59 PM
    Hey there! I've update R2-explorer to be a worker library, this way it can now be deployed/self-hosted in your own Cloudflare account for better privacy R2-Explorer is a Google Drive Interface for managing your Cloudflare R2 Buckets Some of the main features are: - pdf, image, txt, markdown, etc file preview, inside browser window - quick bucket/folder navigation (comparing to Cloudflare dash) - the usual drag and drop and folder managment - file rename - readonly mode You can get this up and running in your own Cloudflare account in under 2 mins, by getting a project template with the command
    npx r2-explorer my-r2-explorer
    You can see an live example, in read-only mode, in your browser at https://r2-explorer.massadas.com/ Github repo: https://github.com/G4brym/R2-Explorer Some features that will be added in the next weeks are: - csv preview support - basic file search - upload folders with files Feedback is appreciated 😁
    s
    n
    +2
    • 5
    • 6
  • Durable Object Proxy (do-proxy)
    o

    osa

    11/29/2022, 8:00 PM
    Hey! Tired of constructing Requests for Durable Objects and routing them manually? Me too. This library handles the fetch request building / routing for Durable Objects and gives easy access to Durable Object instance's state storage and class methods. Usage as-is:
    Copy code
    ts
    // Wrap our proxy around `DurableObjectNamespace`
    const TODO = DOProxy.wrap(env.TODO);
    // Helper shorthand method for `TODO.get(TODO.idFromName(name))`
    const stub = TODO.getByName('my-todos');
    // Access storage via `storage` object
    await stub.storage.put('todo:1', 'has to be done');
    Or extending
    DOProxy
    class:
    Copy code
    ts
    const stub = Todo.wrap(env.TODO).getByName('my-todos');
    // Access class methods via `class` object
    const id = await stub.class.add('has to be done');
    const todo = await stub.class.get(id);
    It also has
    batch
    method, which bundles commands and uses only one fetch request to run them all in sequence:
    Copy code
    ts
    const stub = Todo.wrap(env.TODO).getByName('my-todos');
    const [,,list] = await stub.batch(() => [
      stub.class.add('my todo'),
      stub.class.add('another todo'),
      stub.storage.list()
    ]);
    I hope you find it useful! Repository can be found here: https://github.com/osaton/do-proxy You can play with it at Stackblitz: - Todo app using only
    storage
    &
    batch
    methods: https://stackblitz.com/fork/github/osaton/do-proxy/tree/main/examples/todo-storage?file=src%2Findex.ts&terminal=%27start-stackblitz%27 - Todo app which utilizes
    class
    methods: https://stackblitz.com/fork/github/osaton/do-proxy/tree/main/examples/todo-class?file=src%2Findex.ts&terminal=%27start-stackblitz%27
    a
    • 2
    • 7
  • TSOA for workers
    a

    ahlstrand

    12/18/2022, 2:00 PM
    I just saw another post with people running workers with OAS and thought I'll bring another option to the table. We have been trying out a bunch of different solutions on different platforms and finally settled on TSOA (https://tsoa-community.github.io/docs/getting-started.html) which has worked great for lambdas etc. By using typescript and decorators it gives a single point for docs, validation and code. As it unfortunately had hard node-js dependencies we had to make a small add-on to make it work well with worker, but with this small change it works really well 🙂 Here's a link to the project: https://github.com/markusahlstrand/tsoa-workers Thankful for any feedback 🙂
  • Cloudworker-Router
    a

    ahlstrand

    12/18/2022, 2:07 PM
    I might as well also plug the router I'm using: https://github.com/markusahlstrand/cloudworker-router It's heavily inspired by koa-router and has then same next-solution which makes it easy to do stuff after a route has executed. It also handles options and head requests automatically so you don't have to think about it. And it has a body parser for json included to handle to most common use-cases. We've been running it in production for more than a year now, but let me know if there's any functionality that is missing.
  • apollo-server-integration-cloudflare-workers
    k

    kimyvgy

    12/21/2022, 5:37 AM
    Hi. I've developed an integration to use Cloudflare Workers as a hosting service with Apollo Server V4. https://github.com/kimyvgy/apollo-server-integration-cloudflare-workers I would like to share it with you. If you have some questions or some ideas, please let me know!
  • Cloudflare Pages Plugin for tRPC
    s

    satoshi

    01/02/2023, 8:10 AM
    I am building a Cloudflare page plugin for tRPC. And finally, it can interact with Cloudflare D1. https://github.com/toyamarinyon/cloudflare-pages-plugin-trpc Demo app is available on https://cloudflare-pages-plugin-trpc.pages.dev/, so please try it!
    s
    a
    b
    • 4
    • 5
  • WASI-ready bcrypt
    l

    lufs

    01/04/2023, 6:12 PM
    Similar to
    argon2-wasi
    , but this time with bcrypt. https://github.com/auth70/bcrypt-wasi
    d
    • 2
    • 1
  • Cloudflare Workers with gapi?
    s

    sten

    01/12/2023, 8:17 PM
    Just read this post from hookdeck https://hookdeck.com/blog/post/how-to-call-google-cloud-apis-from-cloudflare-workers#homemade-client-overview They mention > Note that Google does offer a pure JavaScript SDK (intended for browser usage) known as GAPI which would syntactically be compatible with Cloudflare Workers, but it only supports OAuth or API key authentication, and not service account, which is necessary in our backend case. See Google Cloud authentication strategies. Is that really possible inside CF workers?
  • Topic-based GraphQL Subscriptions on Workers
    h

    hansottowirtz

    01/19/2023, 4:54 AM
    We've built an easy to use topic-based GraphQL subscriptions broker using Workers, Durable Objects and D1! Easily use
    publish("GREETINGS", { greeting: "hi!" })
    anywhere, and it will be sent to the right subscribers. Features: - in-database json filtering -
    /publish
    endpoint - easy integration with existing GraphQL stack, even if it's not on Workers yet Check it out here: https://github.com/bubblydoo/graphql-worker-subscriptions Demo: https://graphql-worker-subscriptions.bubblydoo.workers.dev/graphql (open two tabs and send messages)
  • Proxyflare for Pages - move traffic around your domain with ease
    s

    Steve French

    01/21/2023, 7:46 PM
    Hi everyone, we're excited to share our plugin with the community. Proxyflare for Pages — a reverse proxy to move traffic around your Pages domain with ease • Port forward, redirect, and reroute HTTP and Websocket traffic anywhere on the internet • Mount an entire website on a subpath (e.g. mysite.com/docs) on your apex domain • Serve static text (e.g. robots.txt and other structured metadata) from any URL • much more to come... Lots of examples at https://proxyflare.works/ Try it out on your Pages domain and feel free to ping/DM questions or join the discord channel. Let us know what feature you'd like to see next!
    • 1
    • 1
  • Cloudflare Workers for Dart
    s

    Salakar

    02/05/2023, 8:11 PM
    Hey folks, we've just released the first version of our Dart Edge package, allowing you to write cloudflare Workers in the Dart language; https://github.com/invertase/dart_edge https://docs.dartedge.dev/platform/cloudflare
    • 1
    • 1
  • Remix ESM Adapter
    h

    huw

    02/07/2023, 12:19 AM
    @DarioP Happy to knock this out as a community package, but I just wanted to align with you—would you prefer I maintain it, or did you want to?
    s
    d
    p
    • 4
    • 15
  • Hono v3
    y

    yusukebe

    02/21/2023, 1:32 PM
    Hi there. Hono v3 has been released! https://github.com/honojs/hono/releases/tag/v3.0.0 Many new features, including RPC mode and an Adapter for Cloudflare Pages. and there is also a new website with the domain hono.dev . Enjoy! https://hono.dev/
    r
    w
    +5
    • 8
    • 16
  • trpc-durable-objects
    a

    ahlstrand

    02/25/2023, 8:41 PM
    Hi, I put together way to use trpc with durable objects: https://www.npmjs.com/package/trpc-durable-objects When thinking about it it feels like durable objects is the typical RPC-scenario and https://trpc.io provides a really slick way of getting type-safe remote procedure calls. I'm pretty new to both durable obejcts and trpc, but so far so good 🙂 Any feedback appreciated.
    o
    • 2
    • 1
  • darkflare (v8 soon)
    b

    boywithkeyboard

    02/26/2023, 10:54 PM
    Check it out: https://github.com/azurystudio/darkflare
    n
    j
    • 3
    • 13
  • Drii
    s

    Sorry 🙏

    03/17/2023, 4:19 AM
  • Open Telemetry compatible tracing library
    e

    Erwin

    04/05/2023, 8:48 AM
    Not just an Open Telemetry exporter, but allowing things like custom span creation with
    trace.getTracer('name').startActiveSpan
    , auto-instrumented
    fetch
    and
    caches
    , and automatically include tracing from libraries that support the Open Telemetry tracing standard. https://github.com/evanderkoogh/otel-cf-workers
    b
    r
    +12
    • 15
    • 276
  • Turborepo remote cache using Cloudflare Workers and R2
    a

    adiswa123

    04/07/2023, 5:48 AM
    Hey everyone. For anyone like me who has a new obsession with running everything on Cloudflare workers, I made an implementation of turborepo remote cache that is built specifically to run in the Cloudflare ecosystem - https://github.com/AdiRishi/turborepo-remote-cache-cloudflare It runs the remote cache server on Cloudflare workers and stores the cache objects in Cloudflare R2. Super easy to deploy! Hopefully this helps anyone looking to setup a remote cache for turborepo in Cloudflare. I know I struggled with this for a while.
    s
    • 2
    • 4
  • cheetah
    b

    boywithkeyboard

    04/17/2023, 11:05 AM
    Coming this week!
  • cheetah
    b

    boywithkeyboard

    04/17/2023, 11:24 AM
    A batteries-included, blazingly fast framework for Cloudflare Workers + Deno!
    s
    j
    d
    • 4
    • 18
  • 🌩 🔍 Cloudflare Serverless Search (R2, Worker, Cache API, Queue)
    f

    Felix || TM9657

    05/20/2023, 12:00 AM
    We have created a small project for our search purposes (small - medium datasets, to replace algolia, which is quite expensive when your users search a lot) https://github.com/TM9657/serverless-cloudflare-search Provides: - an indexing endpoint - serverless search with R2, Cache API, Queues and Worker - low latency for small - medium datasets [we have tested a movie dataset, 20k movies] (initial 100 - 500ms, cached response 20-40 ms) - multiple parallel indices - arbitrary data (you defined the searchable objects fields and the ID name of your object) Maybe you find this useful for your own purposes (remember to leave a star if you do so :)) There are probably ways to speed this up, feel free to create a pull request, we have found this architecture to be the cheapest for our use-case at the moment.

    https://cdn.discordapp.com/attachments/1109269288935764008/1109269289145466900/serverless_search.png▾

    z
    • 2
    • 2
  • Tempo: efficient, end-to-end typesafe APIs.
    a

    andrew.rfc

    05/23/2023, 3:51 AM
    Hey everyone! I wanted to share an exciting project I've been working on called Tempo. It's a powerful RPC framework designed to make building and consuming low-latency, cross-platform, and fully typesafe APIs a breeze. Think of Tempo as a fantastic alternative to gRPC and Protocol Buffers. It leverages the impressive capabilities of Bebop for binary serialization and code generation, offering a seamless experience. Whether you're working on client-server applications or distributed web apps, Tempo provides a faster, more concise, and highly typesafe alternative to JSON or MessagePack, without the added complexity of solutions like Protocol Buffers or FlatBuffers. The best part? We've just introduced streaming support, taking Tempo to the next level. But before we continue to enhance it, we would greatly appreciate your valuable feedback. If you're building on top of Workers and looking for an efficient RPC framework, check out Tempo on GitHub: https://github.com/betwixt-labs/tempo/ Note: Tempo currently only supports Typescript, but Bebop under the hood supports C#, Rust, C++, and others as well so we'll be introducing further Tempo runtimes as we get feedback.

    https://cdn.discordapp.com/attachments/1110414707250167889/1110414707724128256/logo.png▾

    s
    • 2
    • 6
  • itty-router v4
    k

    Kevin W - Itty

    05/27/2023, 4:39 PM
    Hey all! After ages in testing and development, itty-router v4 has been officially released! Documentation: https://itty.dev/itty-router Release Tag: https://github.com/kwhitley/itty-router/releases/tag/v4.0.0 NPM: https://www.npmjs.com/package/itty-router This brings a ton of quality of life fixes for itty/extras users: - itty-router-extras are all included in the core library (with one exception) - response helpers may be used downstream to safely transform unformed responses - error helper may be used downstream to catch errors as well - withParams may be used globally (as upstream middleware) - createCors (from itty-cors) has been added to the core library as well - complete rewrite of the Types, allowing for MUCH better type support throughout your routes, including strongly typing your extra args (e.g.
    env
    , and
    context
    from Cloudflare Workers). - Full documentation site dedicated to the v4 API at https://itty.dev/itty-router
  • lol-html not selecting tags/sub elements inside noscript element
    u

    _pirate.king_

    01/11/2024, 5:25 PM
    lol-html not selecting tags/sub elements inside noscript tag I see there is an open GitHub issue(https://github.com/cloudflare/lol-html/issues/184 as well in lol-html library but it's still not fixed..) Any idea guys when this will be fixed or if you can provide any workaround?? To select a subelement inside noscript element.
    z
    h
    +2
    • 5
    • 27