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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@e280/mammoth

v0.1.0-23

Published

big file storage

Downloads

3,740

Readme

🦣 mammoth

big files. small api.

mammoth is a file storage typescript library. we use it in our web apps to store files like user uploads. it's content-addressed. files are streamed into a depot, identified by their blake3 hash, and deduplicated. mammoth works the same whether it's backed in memory, on disk, in the cloud, or in the browser's opfs. mammoth uses kv for bookkeeping.

npm install @e280/mammoth @e280/kv
import {Mammoth} from "@e280/mammoth"

const mammoth = new Mammoth()

🦣 mammoth stores files.

  • write a file, and you get back its blake3 hash and size in bytes.
    const hash = await mammoth.write(blob.stream())
  • read a file, identified by its hash.
    const blob = await mammoth.read(hash)
  • delete a file.
    await mammoth.delete(hash)

🦣 mammoth is depot-agnostic.

  • memory depot, for testing.
    import {Mammoth, MemoryDepot} from "@e280/mammoth"
    import {Kv} from "@e280/kv"
    
    const mammoth = new Mammoth(
    
      // depot is a bucket for blob storage
      new MemoryDepot(),
    
      // kv for metadata bookkeeping
      new Kv(),
    )
    defaults shown, this is equivalent:
    const mammoth = new Mammoth()
  • disk depot, for nodejs servers, example using leveldb. (note the import paths)
    import {Mammoth, DiskDepot} from "@e280/mammoth/node"
    import {Kv, LevelMagazine} from "@e280/kv"
    import {Level} from "level"
    
    const mammoth = new Mammoth(
      new DiskDepot("./data/mammoth/depot"),
      new Kv(new LevelMagazine(new Level("./data/mammoth/kv"))),
    )
  • opfs depot, with indexedDB kv for clientside in-browser storage.
    import {Mammoth, OpfsDepot} from "@e280/mammoth"
    import {Kv, idbOpen, IdbMagazine} from "@e280/kv"
    
    const mammoth = new Mammoth(
      new OpfsDepot(await navigator.storage.getDirectory()),
      new Kv(new IdbMagazine(await idbOpen("mammoth"))),
    )

🦣 more mammoth methods.

  • check if a file exists, get back a boolean.
    const exists = await mammoth.has(hash)
  • get file info, including size in bytes, added timestamp, and depot id.
    const {size, added, id} = await mammoth.info(hash)
  • get stats, for the whole datalake.
    await mammoth.stats()
      // {count: 123, size: 123456789}
  • loop over every file, with their hashes and infos.
    for await (const [hash, info] of mammoth.entries())
      console.log(hash, info)

🦣 mammoth-brained tips.

  • analyze is for hashing files.
    import {analyze} from "@e280/mammoth"
    
    const {hash, size} = await analyze(blob.stream())
  • analyze can help you avoid unnecessary uploads.
    const {hash} = await analyze(blob.stream())
    
    if (!await mammoth.has(hash))
      await mammoth.write(blob.stream())
  • streamify makes a stream for a Uint8Array.
    import {streamify} from "@e280/mammoth"
    
    const readable = await streamify(new Uint8Array([0xDE, 0xAD, 0xBE, 0xEF]))

https://e280.org/