New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@teawithsand/tws-filesend

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teawithsand/tws-filesend

Transmit files over WebRTC + tws-async-peer easily.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

tws-filesend

Library and accompanying web application using it, which allows for transferring files between devices.

This library is kind of showcase how to use tws-async-peer

Docs

Go to github pages for documentation

How does the library work?

See app as an example. Also you can take a look at the docs.

How does the app work?

From user perspective:

  1. Sending party picks files that they want to send.
  2. One party(either receiving or sending) generates token.
  3. The other party somehow receives that token, either via string, scanning QRCode or sth like that.
  4. Both parties accept each other(explicit step) and files are streamed over WebRTC connection from sender to receiver.
  5. User either saves(AKA downloads; we are in web world) those files, or programmer does something fancy with them.

In case you need more detailed info, check out the docs available directly with code.

A few notes at the end

It uses my homegrown event busses, which are so-so but work more than OK

This library uses @teawithsand/tws-async-peer EventBus type from @teawithsand/ttws-lts, because it was first built on top of tws-stl (part of tws-libs). It's something like ~100sloc implementation of RxJS, but it's quite convenient to use nevertheless.

There is nothing wrong in this lib using my own implementation of event bus for handling events, but IMHO it's kind of unsound of me to reinvent the wheel. Just check out the docs for tws-lts.

Also if you use react, check out tws-lts-react, which provides some neat hooks, which make it really easy to hook to busses and especially sticky busses.

Keywords

FAQs

Package last updated on 22 Jul 2023

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