era-fs
v0.1.1
Published
ERA File System. Bridging the gap between [GUN](https://gun.eco/) and [Sia](https://siasky.net/) with an easy to use file system API. It is essentially a SEA wrapper over Skynet.
Downloads
121
Readme
efs
ERA File System. Bridging the gap between GUN and Sia with an easy to use file system API. It is essentially a SEA wrapper over Skynet.
This is a really basic proof of concept that only supports the browser. If you decide to use it please consider running your own portal.
Installation
yarn add era-fs
Usage
const Gun = require("gun/gun")
require("gun/sea")
const Efs = require("era-fs")
const gun = Gun()
const user = gun.user()
const efs = Efs(user)
const profileUpload = document.getElementById("profile-upload")
profileUpload.oninput = async (e) => {
const file = e.target.files[0]
await efs.save("pics/profile", file) // uploads to Skynet and saves the link
const img = document.getElementById("profile-img")
efs.link("pics/profile", link => {
img.src = link
})
}