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

@arikajs/storage

v0.0.4

Published

Filesystem abstraction layer for the ArikaJS framework.

Readme

Arika Storage

@arikajs/storage is the filesystem abstraction layer for the ArikaJS framework.

It provides a clean, unified API to work with local and cloud-based storage systems using interchangeable drivers, inspired by Laravel's Storage but designed for Node.js and TypeScript.

This package allows ArikaJS applications to interact with files without caring where or how they are stored.


✨ Features

  • Multiple storage disks: Configure different storage locations
  • Driver-based filesystem architecture: Pluggable storage backends
  • Local filesystem driver: Built-in support for local file storage (v1)
  • Unified file API: put, get, delete, exists, url
  • Buffer, string, and stream support: Flexible content handling
  • Configuration-based disk resolution: Easy setup via config files
  • TypeScript-first: Full type safety with JavaScript compatibility
  • Designed for cloud drivers: Ready for S3, GCS, Azure (planned)

📦 Installation

npm install @arikajs/storage
# or
yarn add @arikajs/storage
# or
pnpm add @arikajs/storage

🚀 Quick Start

Basic File Operations

import { Storage } from '@arikajs/storage';

// Write a file
await Storage.put('files/example.txt', 'Hello Arika');

// Read a file
const content = await Storage.get('files/example.txt');

// Delete a file
await Storage.delete('files/example.txt');

💽 Working with Disks

Arika Storage supports multiple disks, each backed by a driver.

// Use a specific disk
await Storage.disk('local').put('notes.txt', 'Hello');

// Check if file exists on a disk
const exists = await Storage.disk('public').exists('image.png');

⚙️ Configuration

Storage disks are defined in your application configuration:

export default {
  default: 'local',

  disks: {
    local: {
      driver: 'local',
      root: './storage/app'
    },

    public: {
      driver: 'local',
      root: './storage/public',
      url: '/storage'
    }
  }
};

📁 Supported Drivers (v1)

| Driver | Status | | :--- | :--- | | Local filesystem | ✅ Supported | | Amazon S3 | ✅ Supported | | Google Cloud Storage | ⏳ Planned | | Azure Blob Storage | ⏳ Planned |


📚 API Reference

Storage.put(path, contents)

Write contents to a file.

await Storage.put('file.txt', 'content');

Storage.get(path)

Read file contents.

const content = await Storage.get('file.txt');

Throws FileNotFoundException if the file does not exist.

Storage.exists(path)

Check if a file exists.

const exists = await Storage.exists('file.txt');

Storage.delete(path)

Delete a file.

await Storage.delete('file.txt');

Storage.url(path)

Get the public URL for a file.

const url = Storage.url('image.png');

Returns a public URL if supported by the disk.


🧠 Architecture

storage/
├── src/
│   ├── StorageManager.ts     ← Resolves disks and drivers
│   ├── Disk.ts               ← Disk wrapper
│   ├── Drivers/
│   │   └── LocalDriver.ts    ← Local filesystem implementation
│   ├── Contracts/
│   │   └── Filesystem.ts     ← Driver interface
│   ├── Exceptions/
│   │   └── FileNotFoundException.ts
│   └── index.ts
├── tests/
│   └── Storage.test.ts
├── package.json
├── tsconfig.json
├── README.md
└── LICENSE

🔌 Extending Storage (Custom Drivers)

You can create your own storage driver:

import { Filesystem } from '@arikajs/storage';

class CustomDriver implements Filesystem {
  async put(path: string, contents: string | Buffer): Promise<void> {
    // Implementation
  }

  async get(path: string): Promise<Buffer> {
    // Implementation
  }

  async delete(path: string): Promise<void> {
    // Implementation
  }

  async exists(path: string): Promise<boolean> {
    // Implementation
  }

  url(path: string): string {
    // Implementation
  }
}

Register it inside StorageManager.


🔗 Integration with ArikaJS

@arikajs/storage integrates seamlessly with:

  • @arikajs/auth → User uploads
  • @arikajs/mail → Attachments
  • @arikajs/logging → File logs
  • @arikajs/queue → Temporary files
  • @arikajs/view → Asset handling

🧪 Testing

The storage layer is fully testable by mocking drivers or using temporary disks.


🛣 Roadmap

  • [x] S3 driver
  • [x] Streaming API
  • [x] Temporary signed URLs
  • [x] Disk-level middleware
  • [x] File metadata support

📄 License

@arikajs/storage is open-source software licensed under the MIT License.


🧭 Philosophy

"Your application should care about files, not filesystems."