jupiter-fs
A small file system implementation for the Jupiter blockchain.
Install
$ npm install -s jupiter-fs
Usage
import JupiterFs from 'jupiter-fs'
const jupFs = JupiterFs({
server: 'https://jpr.gojupiter.tech',
address,
passphrase,
encryptSecret,
})
const listOfFiles = await jupFs.ls()
await jupFs.writeFile('myFile.txt', Buffer.from('jupToTheMoon'))
const buffer = await jupFs.getFile({ name: 'myFile.txt' })
const buffer = await jupFs.getFile({
id: '123e4567-e89b-42d3-a456-556642440000',
})
await readStream = await jupFs.getFileStream({ name: 'myFile.txt' })
await jupFs.deleteFile('123e4567-e89b-42d3-a456-556642440000')