Package Exports
- socket-file
- socket-file/lib/socket-file.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (socket-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Socket-file

File processing with help of socket.io.
Install
npm i socket-file --saveHow to use?
import http from 'node:http';
import {socketFile} from 'socket-file';
import express from 'express';
import {Server} from 'socket.io';
const app = express();
const server = http.createServer(app);
const socket = new Server(server);
server.listen(port, ip);
socketFile(socket, {
prefix: 'edward',
// string or function
root: '/',
// max file size for patch
size: '512000',
auth: (accept, reject) => (username, password) => {
accept();
},
});License
MIT