{"id":16641593,"url":"https://github.com/scrwdrv/folder-encrypt","last_synced_at":"2025-10-30T11:31:06.374Z","repository":{"id":57239655,"uuid":"233345019","full_name":"scrwdrv/folder-encrypt","owner":"scrwdrv","description":"Simple module that helps you encrypt \u0026 decrypt folder with password.","archived":false,"fork":false,"pushed_at":"2020-09-02T17:09:57.000Z","size":1220,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T08:11:20.424Z","etag":null,"topics":["aes","aes-encryption","decryption","directory","encryption","folder","fs","promise","tar","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/scrwdrv.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-01-12T05:48:51.000Z","updated_at":"2024-01-01T14:33:02.000Z","dependencies_parsed_at":"2022-08-29T21:23:18.157Z","dependency_job_id":null,"html_url":"https://github.com/scrwdrv/folder-encrypt","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/scrwdrv%2Ffolder-encrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Ffolder-encrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Ffolder-encrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Ffolder-encrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scrwdrv","download_url":"https://codeload.github.com/scrwdrv/folder-encrypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238960239,"owners_count":19559222,"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":["aes","aes-encryption","decryption","directory","encryption","folder","fs","promise","tar","typescript"],"created_at":"2024-10-12T07:47:10.926Z","updated_at":"2025-10-30T11:31:06.021Z","avatar_url":"https://github.com/scrwdrv.png","language":"TypeScript","readme":"# folder-encrypt\n Simple module that helps you encrypt \u0026 decrypt folder/file with password.\n\n## Installation\n```sh\nnpm i folder-encrypt\n```\n\n## Usage\nBoth methods (```encrypt```, ```decrypt```) of folder-encrypt use Promise, and it will automatically detect whether this path is a file or directory.\n\n### Folder/File Encryption\n```js\nimport * as folderEncrypt from 'folder-encrypt';\n\nfolderEncrypt.encrypt({\n    password: 'your-password',\n    input: 'your-file-or-folder',\n    output: 'your-file-or-folder.encrypted' // optional, default will be input path with extension `encrypted`\n}).then(() =\u003e {\n    console.log('encrypted!');\n}).catch((err) =\u003e {\n    console.log(err);\n});\n```\n\n#### Stream as Output\n```js\nimport * as folderEncrypt from 'folder-encrypt';\nimport { Writable } from 'stream';\nimport * as fs from 'fs';\n\nconst outputs = [\n    fs.createWriteStream('./output1'),\n    fs.createWriteStream('./output2')\n], writeStream = new Writable({\n    write(chunk, encoding, next) {\n        for (let i = outputs.length; i--;)  outputs[i].write(chunk);\n        next();\n    }\n});\n\nfolderEncrypt.encrypt({\n    password: 'your-password',\n    input: 'your-file-or-folder',\n    output: writeStream // writable stream\n}).then(() =\u003e {\n    console.log('encrypted!');\n}).catch((err) =\u003e {\n    console.log(err)\n});\n```\n### Folder/File Decryption\n```js\nfolderEncrypt.decrypt({\n    password: 'your-password',\n    input: 'your-file-or-folder.encrypted',\n    output: 'your-file-or-folder' // optional, default will be input path without extension\n}).then(() =\u003e {\n    console.log('decrypted!');\n    // when using a wrong password on file decryption, the file will be decrypted to a bunch of garbled text. \n    // But still considered `decrypted` due to there is no way knowing the original content.\n}).catch((err) =\u003e {\n    console.log(err); \n    // when using a wrong password on directory decryption, a `tar is corrupted` error will occured.\n});\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrwdrv%2Ffolder-encrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrwdrv%2Ffolder-encrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrwdrv%2Ffolder-encrypt/lists"}