{"id":15043761,"url":"https://github.com/cloudcmd/node-spero","last_synced_at":"2026-04-08T20:50:37.425Z","repository":{"id":32707319,"uuid":"36296890","full_name":"cloudcmd/node-spero","owner":"cloudcmd","description":"File copy emitter middleware based on socket.io and copymitter","archived":false,"fork":false,"pushed_at":"2018-05-01T16:29:46.000Z","size":114,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T08:45:24.715Z","etag":null,"topics":["cloudcmd","copy","emitter","expressjs","file","folder","middleware","progress","socket-io"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudcmd.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-26T13:15:19.000Z","updated_at":"2018-05-01T16:30:22.000Z","dependencies_parsed_at":"2022-07-09T15:18:11.881Z","dependency_job_id":null,"html_url":"https://github.com/cloudcmd/node-spero","commit_stats":null,"previous_names":["coderaiser/node-spero"],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/cloudcmd/node-spero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fnode-spero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fnode-spero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fnode-spero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fnode-spero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudcmd","download_url":"https://codeload.github.com/cloudcmd/node-spero/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcmd%2Fnode-spero/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cloudcmd","copy","emitter","expressjs","file","folder","middleware","progress","socket-io"],"created_at":"2024-09-24T20:49:33.790Z","updated_at":"2026-04-08T20:50:37.400Z","avatar_url":"https://github.com/cloudcmd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spero [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]\n\nFile copy emitter middleware based on [socket.io](http://socket.io \"Socket.io\") and [copymitter](https://github.com/coderaiser/node-copymitter \"Copymitter\").\n\n## Install\n\n```\nnpm i spero --save\n```\n\n## Client\n\nCould be loaded from url `/spero/spero.js`.\n\n```js\nconst prefix = '/spero';\n\n/* could be one argument: callback */\nspero(prefix, function(copier) {\n    const from = '/';\n    const to = '/tmp';\n    const names = [\n        'bin'\n    ];\n    const progress = (value) =\u003e {\n        console.log('progress:', value);\n    };\n    \n    const end = () =\u003e {\n        console.log('end');\n        copier.removeListener('progress', progress);\n        copier.removeListener('end', end);\n    };\n    \n    const error = (data) =\u003e {\n        const msg = data + '\\n Continue?';\n        const is = confirm(msg);\n        \n        if (is)\n            return copier.continue();\n        \n        copier.abort();\n    };\n    \n    copier(from, to, names);\n    \n    copier.on('progress', progress);\n    copier.on('end', end);\n    copier.on('error', error);\n});\n```\n\n## Server\n\n```js\nconst spero = require('spero');\nconst http = require('http');\nconst express = require('express');\nconst io = require('socket.io');\nconst app = express();\nconst port = 1337;\nconst server = http.createServer(app);\nconst socket = io.listen(server);\n\nserver.listen(port);\n\napp.use(spero({\n    online: true,\n    authCheck: function(socket, success) {\n    }\n});\n\nspero.listen(socket, {\n    prefix: '/spero',   /* default              */\n    root: '/',          /* string or function   */\n});\n```\n\n## Environments\n\nIn old `node.js` environments that supports `es5` only, `dword` could be used with:\n\n```js\nvar spero = require('spero/legacy');\n```\n\n## License\n\nMIT\n\n[NPMIMGURL]:                https://img.shields.io/npm/v/spero.svg?style=flat\n[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/node-spero/master.svg?style=flat\n[NPMURL]:                   https://npmjs.org/package/spero \"npm\"\n[LicenseURL]:               https://tldrlegal.com/license/mit-license \"MIT License\"\n[BuildStatusURL]:           https://travis-ci.org/coderaiser/node-spero  \"Build Status\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudcmd%2Fnode-spero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudcmd%2Fnode-spero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudcmd%2Fnode-spero/lists"}