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

@antelopejs/file-storage-local

v0.2.3

Published

Local filesystem storage module for AntelopeJS, implementing the File Storage interface for development and single-instance deployments

Readme

@antelopejs/file-storage-local

The AntelopeJS file storage module for a single machine. It stores files on the local filesystem and serves signed upload and read URLs.

Documentation · Interfaces · All interfaces and providers

The AntelopeJS file storage module for a single machine. It keeps the files of the file storage interface on the local filesystem and serves signed upload and read URLs through the API module.

Use it for development and for a deployment with one instance, because instances do not share files. For several instances, use @antelopejs/file-storage-s3.

In production, run exactly one instance and put storagePath on a persistent disk. A container's temporary directory loses every file when the instance sleeps, restarts, or is replaced. A second instance never sees the files of the first, so an upload can land on one instance and its confirmation on the other. On AntelopeJS Cloud, attach a volume to the service and point storagePath at its mount path. Attaching a volume keeps the service at one replica. The module cannot tell a persistent disk from a temporary one, so it logs a warning on every start outside dev mode.

Interfaces

| Interface | Documentation | | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | | @antelopejs/interface-file-storage | File storage |

The interface pages document uploads, reads, visibility, metadata, staging, and promotion. The module serves its routes through @antelopejs/interface-api, implemented by @antelopejs/api.

Install

ajs project modules add @antelopejs/file-storage-local
ajs project modules install

ajs project modules install adds a module for each interface that the project imports and no module implements. For @antelopejs/interface-api, that module is @antelopejs/api. This module ships no default configuration, so add a config block with at least storagePath and baseUrl.

Configuration

import { defineConfig } from "@antelopejs/interface-core/config";

export default defineConfig({
  name: "my-project",
  modules: {
    "file-storage-local": {
      source: {
        type: "package",
        package: "@antelopejs/file-storage-local",
        version: ">=0.2.0 <0.3.0",
      },
      config: {
        storagePath: ".antelope/storage",
        baseUrl: "${@api.API_PUBLIC_BASE_URL}",
        defaultVisibility: "private",
        uploadTokenExpiration: 3600,
        readTokenExpiration: 60,
        cleanupInterval: 300,
        stagingExpiration: 86400,
        storages: {
          media: {
            storagePath: ".antelope/media",
            baseUrl: "${@api.API_PUBLIC_BASE_URL}",
            defaultVisibility: "public",
          },
        },
      },
    },
  },
});

| Key | Default | Description | | ----------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------- | | storagePath | required | Folder that holds the files. | | baseUrl | required | Public origin of the API module. Upload and read URLs start with <baseUrl>/file-storage/. | | defaultVisibility | "private" | Visibility of a file uploaded without one, "public" or "private". | | uploadTokenExpiration | 3600 | Lifetime of an upload URL, in seconds. | | readTokenExpiration | 60 | Lifetime of a private read URL when CreateReadUrl gets no expiresIn, in seconds. | | cleanupInterval | 300 | Interval of the expired-token cleanup, in seconds. 0 or less turns the cleanup off. | | stagingExpiration | none | When set, the cleanup also deletes staged files older than this many seconds. Without it, staged files stay. | | storages | none | Named storages, each with the keys above except storages. Address one with the storage argument of the interface functions. |

A named storage gets the same defaults for the keys it leaves out. The cleanup and the staging sweep run on each storage with its own cleanupInterval and stagingExpiration.

${@api.API_PUBLIC_BASE_URL} is a config variable that @antelopejs/api publishes under the module key api. Storage folders must not overlap, and the storage name default is reserved. The module refuses to start otherwise.

Quick start

In the module that handles uploads, add the interface:

pnpm add @antelopejs/interface-file-storage
import {
  CreateReadUrl,
  CreateUploadUrl,
} from "@antelopejs/interface-file-storage";

const upload = await CreateUploadUrl(
  { filename: "avatar.png", size: 52_000, mimetype: "image/png" },
  { maxSize: 1_000_000, allowedMimetypes: ["image/png", "image/jpeg"] },
);

const read = await CreateReadUrl(upload.resourceKey);

The client sends the file with PUT upload.uploadUrl and the returned upload.headers, then fetches it from read.url.

Platform notes

  • Resource keys and upload paths use / as the separator and stay inside their storage. The module rejects . and .. segments.
  • A generated key keeps the extension of the uploaded file only when the extension has 1 to 16 letters, digits, _, or -.
  • The module publishes files with hard links, so storage folders must be on a filesystem that supports them. On Windows, use NTFS.
  • On Windows, keys that differ only by letter case address the same file. The module rejects segments that Windows cannot store: reserved characters, control characters, a trailing dot or space, and device names such as CON or NUL.

Documentation

  • File storage documents the @antelopejs/interface-file-storage contract that this module implements.
  • Configuration covers module sources, config blocks, and config variables in antelope.config.ts.

Compatibility

| Package | Supported | Tested with | | ------------------------------------ | ---------------- | ----------- | | @antelopejs/interface-api | >=0.3.3 <0.4.0 | 0.3.3 | | @antelopejs/interface-core | >=0.5.1 <0.6.0 | 0.5.1 | | @antelopejs/interface-file-storage | >=0.1.6 <0.2.0 | 0.1.8 |

CI runs the tests on Linux and Windows, with the Node.js release that .nvmrc names.

Contributing

pnpm install
pnpm lint
pnpm format:check
pnpm knip
pnpm test           # build, then ajs module test

The tests also run the shared conformance suite of @antelopejs/interface-file-storage. Read the contribution guidelines before opening a pull request.

Part of AntelopeJS

This package belongs to AntelopeJS, the TypeScript framework where modules depend on contracts and the application chooses the provider. The open-source back office AntelopeJS DMS is built on it.

| Area | Contracts | Providers | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | API | interface-api · interface-api-util · interface-data-api | api | | Auth | interface-auth | auth-jwt | | Database | interface-database · interface-database-decorators · interface-database-catalog · interface-mongodb · interface-rethinkdb | postgres · mysql · mongodb · rethinkdb | | Redis | interface-redis · interface-redis-scheduler | redis | | Email | interface-email | nodemailer · brevo | | File storage | interface-file-storage | file-storage-local · file-storage-s3 | | Payments | interface-payment · interface-subscriptions · interface-stripe | stripe · mollie · checkout-com · payment-subscriptions |

License

Apache-2.0