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

@vankyle/storage-core

v0.2.7

Published

Domain models, interfaces, and application services for vankyle-storage.

Readme

@vankyle-hub/storage-core

Domain models, port interfaces, and the default application service for vankyle-storage.

This package has no dependency on any cloud SDK. It defines what the system models and how it should behave, leaving all infrastructure concerns to provider packages.

What's in here

| Path | Content | |---|---| | domain/models/ | File, Blob, FileVersion, BlobReference, UploadSession, UploadedPart | | domain/enums/ | StorageProvider, UploadMode, UploadSessionStatus, BlobStatus, FileStatus | | domain/value-objects/ | SignedAccess, StorageLocator | | schemas/ | Zod schemas for all six entities | | ports/storage/ | IStorage, StorageCapabilities, and all storage I/O types | | ports/metadata/ | IMetadataStore, IUploadSessionStore, IBlobStore, IFileStore | | ports/services/ | IStorageService | | application/services/ | DefaultStorageService | | application/policies/ | IObjectKeyPolicy, DefaultObjectKeyPolicy | | utils/ | generateId() |

Dependencies

  • @vankyle-hub/storage-shared — errors, Result type, utilities
  • zod — schema validation

Key interfaces

IStorage

The abstraction for object storage operations. Required methods cover object CRUD and the full multipart upload lifecycle. Optional methods (createReadUrl?, createPutUrl?, createUploadPartUrl?) are gated by capabilities.

IMetadataStore

Aggregates IUploadSessionStore, IBlobStore, and IFileStore under a single object.

IStorageService

The public API for application code. Orchestrates uploads, manages blob and file records, and generates access URLs.

| Method | Description | |---|---| | createUploadSession | Starts a new upload session, optionally returning a presigned URL | | getUploadSession | Retrieves an existing session by ID, including all fields saved at creation | | getUploadPartUrl | Returns a presigned URL for a specific part (multipart, client-direct) | | uploadPart | Proxies a part upload through the server | | registerPart | Records a part that the client uploaded directly | | completeUploadSession | Finalises the upload and creates blob + optional file records | | abortUploadSession | Cancels the upload and cleans up the provider session | | getReadUrl | Generates a presigned download URL for a file | | getFile | Fetches a file record by ID | | getBlob | Fetches a blob record by ID | | deleteFile | Soft-deletes a file and marks orphaned blobs |

DefaultStorageService

The reference implementation of IStorageService. Inject it with any IStorage + IMetadataStore combination.

import { DefaultStorageService, UploadMode } from "@vankyle-hub/storage-core";

const service = new DefaultStorageService({
  storage,   // IStorage
  metadata,  // IMetadataStore
  bucket: "my-bucket",
  objectKeyPrefix: "uploads/",
  defaultUploadExpiresInSeconds: 3600,
  defaultReadUrlExpiresInSeconds: 900,
});

See the Getting Started guide for full usage examples.

Object key policy

By default, DefaultObjectKeyPolicy generates keys as:

[prefix/][ownerId/]<uuid>[.ext]

Override by implementing IObjectKeyPolicy:

import type { IObjectKeyPolicy, ObjectKeyPolicyInput } from "@vankyle-hub/storage-core";

class MyKeyPolicy implements IObjectKeyPolicy {
  generate(input: ObjectKeyPolicyInput): string {
    return `${input.ownerId ?? "anon"}/${Date.now()}-${input.fileName ?? "upload"}`;
  }
}

const service = new DefaultStorageService({
  ...,
  objectKeyPolicy: new MyKeyPolicy(),
});