Skip to content

A cloud agnostic JavaScript object storage library that's built with simplicity and local development in mind.

License

Notifications You must be signed in to change notification settings

brihter/storage

Repository files navigation

@brighter/storage

A cloud agnostic JavaScript object storage library that's built with simplicity and local development in mind.

It offers:

  • a unified storage interface (for seamless switching between providers),
  • a local storage provider implementation (enabling local development),
  • a simple, concise API that's tested against real infrastructure and
  • comprehensive documentation.

Why

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

This library takes a different approach.

It introduces a unified storage interface that enables seamless switching between providers and a local storage provider implementation that shortens the feedback loop and maximizes velocity during development.

It's API is easy to use and remember. It removes away the complexity of manually passing around continuation tokens, promise throttling, dealing with various different content encodings and presigning requests.

Quick Start

Installation, using npm:

npm i @brighter/storage

Usage:

import { Storage } from '@brighter/storage'

const 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)

Instead of manually installing and injecting the dependencies, you'll most likely want to use one of the following storage adapters that come pre-bundled with everything required:

For more information:

Roadmap

  • v2.0.0 Azure Blob Storage implementation.
  • v3.0.0 Google Storage implementation.

Testing

npm run test                      # run tests
npm run test -- --provider=local  # run tests for a specific provider

Releasing

npm run release             # set version by bumping the patch number, tag the commit
npm run release -- 1.0.0    # set specific version, tag the commit

About

A cloud agnostic JavaScript object storage library that's built with simplicity and local development in mind.

Topics

Resources

License

Stars

Watchers

Forks