{"id":13691660,"url":"https://github.com/subins2000/simple-peer-files","last_synced_at":"2025-05-02T15:32:53.795Z","repository":{"id":49212753,"uuid":"286323799","full_name":"subins2000/simple-peer-files","owner":"subins2000","description":"A library to send files over WebRTC","archived":false,"fork":false,"pushed_at":"2023-04-20T07:11:44.000Z","size":3057,"stargazers_count":35,"open_issues_count":5,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-13T15:56:01.474Z","etag":null,"topics":["peer","simplepeer","transfers","webrtc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subins2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-08-09T22:02:44.000Z","updated_at":"2024-09-25T09:38:06.000Z","dependencies_parsed_at":"2024-04-08T01:51:30.468Z","dependency_job_id":"e571265f-a21c-435d-9388-0b4ef79a2286","html_url":"https://github.com/subins2000/simple-peer-files","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"c21b42f30807bbf2a8a8dd9c1c493bc8d0278981"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fsimple-peer-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fsimple-peer-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fsimple-peer-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fsimple-peer-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subins2000","download_url":"https://codeload.github.com/subins2000/simple-peer-files/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224319176,"owners_count":17291792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["peer","simplepeer","transfers","webrtc"],"created_at":"2024-08-02T17:00:48.501Z","updated_at":"2024-11-12T17:31:45.517Z","avatar_url":"https://github.com/subins2000.png","language":"TypeScript","funding_links":[],"categories":["Libraries"],"sub_categories":["JavaScript"],"readme":"# WebRTC Simple File Transfer\n\nA simple library to send \u0026 receive files over WebRTC data channels. All you need to pass is a [simple-peer](https://www.npmjs.com/package/simple-peer) object, the file, and an ID!\n\n## Features\n\n* Pause/Resume file transfers\n* No file size limit\n* Independent, just pass a `simple-peer` object\n* Multiple file transfers at the same time using the same `simple-peer` object\n\n## Examples\n\n### Apps Made With SPF\n\n* [WebDrop](https://WebDrop.Space) - A web app to share files and messages across all your devices. [Try It Here!]()\n\n### Simple Example\n\nOpen [this webpage](https://codepen.io/subins2000/pen/abNOggM) in two separate browser windows. This simple example is based on the example shown in [simple-peer README](https://github.com/feross/simple-peer#usage)\n\nSender :\n```\nimport SimplePeerFiles from 'simple-peer-files'\nconst spf = new SimplePeerFiles()\n\nfunction readyToSend () {\n  // peer is the SimplePeer object connection to receiver\n  spf.send(peer, 'myFileID', file).then(transfer =\u003e {\n    transfer.on('progress', sentBytes =\u003e {\n      console.log(sentBytes)\n    })\n    transfer.start()\n  })\n}\n```\n\nReceiver :\n\n```\nimport SimplePeerFiles from 'simple-peer-files'\nconst spf = new SimplePeerFiles()\n\n// peer is the SimplePeer object connection to sender\nspf.receive(peer, 'myFileID').then(transfer =\u003e {\n  transfer.on('progress', sentBytes =\u003e {\n    console.log(sentBytes)\n  })\n\n  // Call readyToSend() in the sender side\n  peer.send('heySenderYouCanSendNow')\n})\n```\n\nYou have to call `spf.receive()` in receiver before you call `spf.send()` in sender. This is to prepare the receiver to accept file before sending starts. This also allows to implement a functionality for the receiver to accept or reject the file.\n\nThanks to [Andrew Bastin's justshare](https://github.com/AndrewBastin/justshare-client/tree/master/src/api) for being a reference in making this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubins2000%2Fsimple-peer-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubins2000%2Fsimple-peer-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubins2000%2Fsimple-peer-files/lists"}