{"id":19358853,"url":"https://github.com/kathan/send-file","last_synced_at":"2025-02-24T12:15:19.296Z","repository":{"id":57124061,"uuid":"102274609","full_name":"kathan/send-file","owner":"kathan","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-05T16:23:49.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T17:24:03.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kathan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-03T15:34:47.000Z","updated_at":"2017-09-03T15:36:33.000Z","dependencies_parsed_at":"2022-08-24T14:59:34.515Z","dependency_job_id":null,"html_url":"https://github.com/kathan/send-file","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fsend-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fsend-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fsend-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fsend-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kathan","download_url":"https://codeload.github.com/kathan/send-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240475230,"owners_count":19807292,"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":[],"created_at":"2024-11-10T07:13:20.187Z","updated_at":"2025-02-24T12:15:19.274Z","avatar_url":"https://github.com/kathan.png","language":"JavaScript","readme":"# send-file\nA Javascript module that simplifies sending files over HTTP ports.\n\n## Usage:\nCreate a server...\n```js\nconst path = require('path');\nconst bodyParser = require('body-parser');\nconst express = require('express');\nconst fileUpload = require('express-fileupload');\nconst app = express();\nconst port = 4536;\n\n//==== Start Server ====\napp.use(bodyParser.urlencoded({ extended: true })); \napp.use(fileUpload());\napp.post('*', (req, res) =\u003e {\n  console.log({file_name: req.files.file.name, data: req.files.file.data.toString()});\n  res.send('Success!');\n});\n\nvar server = app.listen(port, () =\u003e {\n  console.log(`Test app listening on port ${port}!`);\n});\n```\n...then send a file!\n```js\nconst sendFile = require('send-file');\nconst port = 4536;\n\n//==== Send File ====\nsendFile(`http://localhost:${port}`, path.resolve(__dirname, 'test.file'), (err, result, reply)=\u003e{\n  if(result){\n    console.log('Success!');\n  }else{\n    console.log('Error!', reply.statusCode);\n  }\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkathan%2Fsend-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkathan%2Fsend-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkathan%2Fsend-file/lists"}