JSPM

  • Created
  • Published
  • Downloads 23025
  • Score
    100M100P100Q151269F
  • License MIT

A JavaScript object storage library that enables local development.

Package Exports

  • @brighter/storage
  • @brighter/storage/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@brighter/storage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@brighter/storage

@brighter/storage is a JavaScript object storage library that:

  • enables local development,
  • has a simple, concise API and,
  • is tested against real infrastructure.

Why is local development important? Most of today's software talks directly to the cloud, even in local environments. This extends the feedback loop and creates a cloud provider dependency.

This library offers a different approach. It introduces a common interface that enables seamless switching between providers and a local implementation that can be used during local development.

A list of supported providers:

  • local (for local development),
  • s3 (AWS) and
  • r2 (Cloudflare).

Quick Start

Installation, using npm:

npm i @brighter/storage

Usage:

const { Storage } = require('@brighter/storage')

const storage = Storage({
  storage: {
    type: 'local',
    path: '/tmp/storage'
  }
})

const main = async () => {
  await storage.write('msg', 'hi')
  const msg = await storage.read('msg')
  console.log(msg)
}

main().catch(console.error)

For more information, see the documentation.

API

The library aims to provide a simple, concise API that's easy to use and remember.

Constructors:

Properties:

Methods:

It knows how to handle:

  • different content encodings (via iconv-lite),
  • recursive operations and
  • throttling of concurrent operations.

For more information, see the documentation.