
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
peer-file is a little library for doing p2p file transfers over webrtc.
$ npm install peer-file
<script src="/lib/peer.js"></script>
<script src="build.js"></script>
var send = require('peer-file/send')
var receive = require('peer-file/receive')
var peer = new Peer('some-id')
peer.on('connection', function(connection) {
connection.on('open', function() {
// Receive
receive(connection)
.on('incoming', function(file) {
this.accept(file) || this.reject(file)
})
.on('progress', function(file, bytesReceived) {
Math.ceil(bytesReceived / file.size * 100)
})
.on('complete', function(file) {
new Blob(file.data, { type: file.type })
})
// Send
var file = input.files[0]
send(connection, file)
.on('progress', function(bytesSent) {
Math.ceil(bytesSent / file.size * 100)
})
})
})
peer-file was developed using peerjs, however it isn’t bound to that library. So long as the provided connection object emits data events, has a send method, and can handle JSON, it could be substituted.
// Single use
peerfile.send(connection, file)
.on('accept', function() {})
.on('reject', function() {})
.on('progress', function(bytesSent) {})
.on('complete', function() {})
.on('cancel', function() {})
.pause()
.resume()
.cancel()
// Long running
peerfile.receive(connection)
.on('incoming', function(file) {})
.on('progress', function(file, bytesReceived) {})
.on('complete', function(file) {})
.on('cancel', function(file) {})
.accept(file)
.reject(file)
.pause(file)
.resume(file)
.cancel(file)
FAQs
A little library for doing p2p file transfers over webrtc.
We found that peer-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.