bstorejs-react

Server Actions and Components for Bstore, a simple blob store.

MIT License

Downloads
309
Stars
0

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

  1. Image
return ( 
    <BstoreImage 
        path={"http://localhost:8080/bstore/images/image.png"}
        alt="Uploaded file"
        className="max-w-full max-h-full object-contain" 
    />
)
  1. Video
return ( 
    <BstoreVideo
        path={"http://localhost:8080/bstore/videos/video.mp4"}
        controls={true}
        className="max-w-full max-h-full"
    />
)
  1. Application
return ( 
    <BstoreApplication
        path={"http://localhost:8080/bstore/books/book.pdf"}
        type={file?.type || ''}
        className="max-w-full max-h-full"
    />
)
Package Rankings
Top 31.51% on Npmjs.org
Badges
Extracted from project README
bstore NPM Package React Package Demo