Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@functionland/fula

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@functionland/fula

Fula client for building Box Dapp

  • 0.6.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Fula Client

The Fula library abstracts away the protocols and `libp2p` connection, and exposes APIs similar to MongoDB for data persistence and S3 for file storage

Built With

  • libp2p
  • protocols

(back to top)

Getting Started

Use Server with caution and know the risk's because we are at development stage and the identity and encryption is not available, so you become public node that can accessed from anywhere.

Installation

Install NPM package

npm install @functionland/fula --save

or using CDN

<script src="https://cdn.jsdelivr.net/npm/@functionland/fula/dist/web/index.js"></script>

(back to top)

Usage

Start fula and use file storage of fula-server

 import {Fula, createClient} from '@functionland/fula'

 // Create a fula client 
 const fulaClient = await createClient();
 // ...
 // connect to a fula server by its base58 string PeerId
 await fulaClient.connect(serverId)
 // send file and get cid
 // selectedFile send file use StreamReader interface or AsyncItrable and get cid
 // meta {name,type,lastModified,size}
 const FileCid = await fulaClient.sendStreamFile(selectedFile,meta);
 // recive meta data 
 const data = await fulaClient.receiveMeta(fileId);
 // recive file using cid
 const data = await fulaClient.receiveFile(FileCid);
 let reader = new FileReader();
 reader.readAsDataURL(data);
 reader.onloadend = (e) => setContent(reader.result)

For using it With private network:

 import {Fula, createClient} from '@functionland/fula'
 // key_file is file_input[0] (value of file input)
 const privateKey = await key_file.arrayBuffer() 
 // Create a fula client 
 const fulaClient = await createClient({},privateKey);
 // ...
 // connect to a fula server by its base58 string PeerId
 await fulaClient.connect(serverId)
 // send file and get cid
 // selectedFile send file use StreamReader interface or AsyncItrable and get cid
 // meta {name,type,lastModified,size}
 const FileCid = await fulaClient.sendStreamFile(selectedFile,meta);
 // recive meta data 
 const data = await fulaClient.receiveMeta(fileId);
 // recive file using cid
 const data = await fulaClient.receiveFile(FileCid);
 let reader = new FileReader();
 reader.readAsDataURL(data);
 reader.onloadend = (e) => setContent(reader.result)

For more examples, please refer to the Examples

(back to top)

Roadmap

  • Protocols
    • File
    • GraphQL
    • AI
  • Identity
  • Encryption

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

See LICENSE for more information.

(back to top)

FAQs

Package last updated on 10 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc