bstorejs-react
v0.1.16
Published
API Interface for Bstore, a simple blob store.
Downloads
73
Readme
Install
npm i bstorejs-react
Import
import { Put, Get, Del } from 'bstorejs-react'; //Functions
import { BstoreImage, BstoreVideo, BstoreApplication } from 'bstorejs-react'; // Component
Functions
// Upload a File
const res = await Put(file.name, file, 'public');
// Download a File
const res = await Get(file.name, 'public');
// Delete a File
const res = await Del(file.name, 'public');
Components
- Image
return (
<BstoreImage
path={"http://localhost:8080/bstore/images/image.png"}
alt="Uploaded file"
className="max-w-full max-h-full object-contain"
/>
)
- Video
return (
<BstoreVideo
path={"http://localhost:8080/bstore/videos/video.mp4"}
controls={true}
className="max-w-full max-h-full"
/>
)
- Application
return (
<BstoreApplication
path={"http://localhost:8080/bstore/books/book.pdf"}
type={file?.type || ''}
className="max-w-full max-h-full"
/>
)