{"id":15296006,"url":"https://github.com/coderaiser/node-salam","last_synced_at":"2026-01-05T19:06:09.799Z","repository":{"id":65374068,"uuid":"74033134","full_name":"coderaiser/node-salam","owner":"coderaiser","description":"pack and extract zip archives middleware","archived":false,"fork":false,"pushed_at":"2018-06-25T07:51:04.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T10:17:40.807Z","etag":null,"topics":["expressjs","extract","javascript","middleware","nodejs","pack","zip"],"latest_commit_sha":null,"homepage":null,"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/coderaiser.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":"2016-11-17T14:11:09.000Z","updated_at":"2018-06-25T07:51:05.000Z","dependencies_parsed_at":"2023-06-10T02:00:24.348Z","dependency_job_id":null,"html_url":"https://github.com/coderaiser/node-salam","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-salam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-salam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-salam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Fnode-salam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderaiser","download_url":"https://codeload.github.com/coderaiser/node-salam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407755,"owners_count":20610232,"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":["expressjs","extract","javascript","middleware","nodejs","pack","zip"],"created_at":"2024-09-30T18:08:56.528Z","updated_at":"2026-01-05T19:06:09.742Z","avatar_url":"https://github.com/coderaiser.png","language":"JavaScript","readme":"# Salam [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]\n\nPack and extract `zip` archives middleware based on [socket.io](http://socket.io \"Socket.io\") and [onezip](https://github.com/coderaiser/node-onezip \"OneZip\").\n\n## Install\n\n```\nnpm i salam --save\n```\n\n## Client\n\nCould be loaded from url `/salam/salam.js`.\n\n```js\nconst prefix = '/salam';\n\nsalam(prefix, (packer) =\u003e {\n    const from = '/';\n    const to = '/tmp';\n    const names = [\n        'bin'\n    ];\n    \n    const progress = (value) =\u003e {\n        console.log('progress:', value);\n    };\n    \n    const end = () =\u003e {\n        console.log('end');\n        packer.removeListener('progress', progress);\n        packer.removeListener('end', end);\n    };\n    \n    packer.pack(from, to, names);\n    \n    packer.on('progress', progress);\n    packer.on('end', end);\n    packer.on('error', (error) =\u003e {\n        console.error(error.message);\n    });\n});\n\n```\n\n## Server\n\n```js\nconst salam = require('salam');\nconst http = require('http');\nconst express = require('express');\nconst io = require('socket.io');\nconst app = express();\nconst server = http.createServer(app);\nconst socket = io.listen(server);\n\nserver.listen(1337);\n\napp.use(salam({\n    authCheck: (socket, success) =\u003e {\n        success();\n    }\n});\n\nsalam.listen(socket, {\n    prefix: '/salam',   /* default              */\n    root: '/',          /* string or function   */\n});\n```\n\n## Environments\n\nIn old `node.js` environments that not fully supports `es2015`, `salam` could be used with:\n\n```js\nvar salam = require('salam/legacy');\n```\n\n## Related\n\n- [Ishtar](https://github.com/coderaiser/node-ishtar \"Ishtar\") - Pack and extract .tar.gz archives middleware.\n\n## License\n\nMIT\n\n[NPMIMGURL]:                https://img.shields.io/npm/v/salam.svg?style=flat\n[DependencyStatusIMGURL]:   https://img.shields.io/gemnasium/coderaiser/node-salam.svg?style=flat\n[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[NPMURL]:                   https://npmjs.org/package/salam \"npm\"\n[DependencyStatusURL]:      https://gemnasium.com/coderaiser/node-salam \"Dependency Status\"\n[LicenseURL]:               https://tldrlegal.com/license/mit-license \"MIT License\"\n\n[BuildStatusURL]:           https://travis-ci.org/coderaiser/node-salam  \"Build Status\"\n[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/node-salam/master.svg?style=flat\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fnode-salam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderaiser%2Fnode-salam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Fnode-salam/lists"}