siggame/stockage
JavaScript utility that provides a common interface in communicating with Google Storage, AWS S3, and local storage.
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