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

replit-chunk-store

v1.0.0

Published

Replit Database chunk store that is abstract-chunk-store compliant

Downloads

4

Readme

replit-chunk-store

Replit Database chunk store that is abstract-chunk-store compliant

abstract chunk store

Apparently, Replit just allows you to store Buffers in their key-value database, so let's use it to overcome replspace filesystem limitations! Of course, Replit DB does seem to have some limitaitons, but the ones given don't seem to apply anymore, as I've stored far more than 50 MB using this module. Infinite storage glitch, anyone?

Docs

const ReplitStorage = require("replit-chunk-store")
const store = new ReplitStorage(1024)

This implements the abstract-chunk-store interface quite nicely, as it's heavily based off of memory-chunk-store. There's only one difference between using this chunk store and any other: the constructor's opts parameter takes one extra key, key, which allows one to specify the database URL they want to use instead of process.env.REPLIT_DB_URL.

const store = new ReplitStorage(1024, {key: "https://my-repl-db.example.com/"})
// passed as: new Client(opts.key)

If you want to want to access the underlying client, use store.client. Just make sure you haven't destroyed the store before doing so, as I set client to null so that it's garbage-collected.

Man, do I love abstractions and interfaces!

Why?

My recent project webtorrent-server makes use of WebTorrent, which itself uses abstract-chunk-store to store pieces. I was running into issues with running out of space on disk in replspace since WebTorrent in Node.js uses fs-chunk-store by default and the stuff I was torrenting was large. Using memory-chunk-store wasn't cutting it either due to repls having very little RAM. I then rememebered that Replit comes with a database, and here we are.