npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pioche

v0.8.9

Published

Pickaxe in french, get it? Workers, durable objects, pickaxe...

Downloads

11

Readme

Note: To use Durable Objects and Websockets features of Pioche, you need a Cloudflare account with Durable Objects access

⭐ Features

  • [x] Short development time
  • [x] Decorator-based path-to-regexp router
  • [x] Middleware support
  • [x] Simplified, more powerful API for D/O Storage and KV
  • [x] Simplified Worker -> D/O interaction
  • [x] WebSocket handling
  • [x] Minimized invokations and compute time

🔋 Tree Shakeable Batteries Available in pioche-extras

See the installation section of pioche-extras for prebuilt OAuth, log streaming, and middleware to use in your project

💾 Installation

To get started use pioche-scripts

npx pioche-scripts create <AppName>

This will setup an minimal project with a single TypeScript file: helloworld.ts
We can then make changes to functionality and run

npm run build // Generate wrangler.toml and program entry point
npm run dev // Deploy to Cloudflare with remote debugging session
npm run serve // Run locally, debug locally
npm run deploy // Deploy to Cloudflare

After npm run deploy you should see <AppName>.workers.dev gives Hello, World!

📕 Background and why Pioche Exists

Cloudflare (CF) workers platform has 3 major offerings:

  1. Workers: A serverless javascript environment for short lived code. There can be many of the same worker script executing globally at the same time

  2. Durable Objects (D/O): A serverless javascript environment for long lived code or code which requires transactional storage. There can only be one of a D/O script globally at the same time.

  3. Workers KV (KV): A non-transactional distributed key-value store

Workers are web-facing, D/Os are Workers-facing, KV Workers and D/O-facing.
Problem: There is a cumbersome dispatch process to call a D/O from a worker.

D/Os have an in-memory key value store (D/O storage)
Problem: This store has very similar capabilities but use a separate API from KV.

CPU time is charged per GB-sec, storage operations are charged per kB transferred, and Workers and D/Os are charged per invokation.
Problem: We want to only use D/Os when necessary and minimize CPU time and invokations.

Problem: There is no routing functionality

These 4 issues alone greatly increase upstart development time and complexity because orchestrating routing between services and resource management while minimizing cost is a huge task that developers shouldn't need to handle.

People

Pioche was created by Garrett Peake

License

MIT