@siggame/stockage
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

siggame/stockage

JavaScript utility that provides a common interface in communicating with Google Storage, AWS S3, and local storage.

Travis Dependencies NPM Version NPM Total Downloads

Table Of Contents

Description

This library is to act as a common interface to allow us to save, retrieve, and update arbitrary files from a cloud service.

Getting Started

npm install siggame/stockage#stable
import * as stockage from "@siggame/stockage";

Usage

Using Local Stockage


// New instance
const stock = new stockage.LocalStockage();

// Writing data
const id = await stock.write("Hello, World");
const id = await stock.writeBuffer(buffer);
const id = await stock.writeJSON({hello: "world"});

// Reading data
const data = await stock.read(id);
const data = await stock.readBuffer(id);
const data = await stock.readJSON(id);

Contributors

License

View our LICENSE.md

Contributing

View our CONTRIBUTING.md

Package Sidebar

Install

npm i @siggame/stockage

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • user404d