{"id":13396557,"url":"https://github.com/dobbydog/sftp-sync-deploy","last_synced_at":"2025-03-13T23:31:33.125Z","repository":{"id":52244066,"uuid":"75818755","full_name":"dobbydog/sftp-sync-deploy","owner":"dobbydog","description":"[Node.js] Sync local files to remote using SFTP.","archived":false,"fork":false,"pushed_at":"2023-03-04T11:35:23.000Z","size":53,"stargazers_count":25,"open_issues_count":15,"forks_count":17,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T21:01:43.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/dobbydog.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-07T09:07:19.000Z","updated_at":"2023-11-09T10:32:51.000Z","dependencies_parsed_at":"2024-05-30T08:14:12.141Z","dependency_job_id":null,"html_url":"https://github.com/dobbydog/sftp-sync-deploy","commit_stats":{"total_commits":61,"total_committers":3,"mean_commits":"20.333333333333332","dds":0.06557377049180324,"last_synced_commit":"3157572dd5d4b0760491f536b1613b4c99cd3415"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobbydog%2Fsftp-sync-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobbydog%2Fsftp-sync-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobbydog%2Fsftp-sync-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobbydog%2Fsftp-sync-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dobbydog","download_url":"https://codeload.github.com/dobbydog/sftp-sync-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221084708,"owners_count":16753426,"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-07-30T18:00:56.805Z","updated_at":"2024-10-25T11:30:53.775Z","avatar_url":"https://github.com/dobbydog.png","language":"TypeScript","readme":"# sftp-sync-deploy\n\nSync local files to remote using SFTP.\n\n## Usage\n\n### Javscript\n\n```js\nconst { deploy } = require('sftp-sync-deploy');\n\nlet config = {\n  host: 'example.com',            // Required.\n  port: 22,                       // Optional, Default to 22.\n  username: 'user',               // Required.\n  password: 'password',           // Optional.\n  privateKey: '/path/to/key.pem', // Optional.\n  passphrase: 'passphrase',       // Optional.\n  agent: '/path/to/agent.sock',   // Optional, path to the ssh-agent socket.\n  localDir: 'dist',               // Required, Absolute or relative to cwd.\n  remoteDir: '/path/to/dest'      // Required, Absolute path only.\n};\n\nlet options = {\n  dryRun: false,                  // Enable dry-run mode. Default to false\n  exclude: [                      // exclude patterns (glob)\n    'node_modules',\n    'src/**/*.spec.ts'\n  ],\n  excludeMode: 'remove',          // Behavior for excluded files ('remove' or 'ignore'), Default to 'remove'.\n  forceUpload: false,             // Force uploading all files, Default to false(upload only newer files).\n  concurrency: 100                // Max number of SFTP tasks processed concurrently. Default to 100.\n};\n\ndeploy(config, options).then(() =\u003e {\n  console.log('success!');\n}).catch(err =\u003e {\n  console.error('error! ', err);\n});\n```\n\n### TypeScript\n\n```ts\nimport { deploy, SftpSyncConfig, SftpSyncOptions } from 'sftp-sync-deploy';\n\nlet config: SftpSyncConfig = {...};\nlet options: SftpSyncOptions = {...};\n\ndeploy(config, options);\n```\n\n## Dry run mode\n\n```js\ndeploy(config, {dryRun: true});\n```\n\nOutputs the tasks to be done for each file in following format. Any changes of the files will not be performed.\n\n```\n[ (local file status) | (remote file status) ] (file path)\n                                               -\u003e (task)\n```\n\n### Output example\n\n```\n# Local is a file (upload the file)\n[ F | F ] index.html\n          -\u003e upload\n\n# Local is a directory (sync recursively)\n[ D | D ] lib\n          -\u003e sync\n\n# Remote exists and local doesn't (remove the remote file or directory)\n[   | F ] index.html.bak\n          -\u003e remove remote\n\n# Excluded (do nothing)\n[ X |   ] node_modules\n          -\u003e ignore\n\n# Excluded and remote exists (operation depends on excludeMode option)\n[ X | D ] .bin\n          -\u003e remove remote # if excludeMode is 'remove'\n          -\u003e ignore        # if excludeMode is 'ignore'\n\n# Local and remote have the same name but different types (remove remote then upload local)\n[ F | D ] test\n          -\u003e remove remote and upload\n\n# Permission error on a remote server (ignored)\n[ F | ! ] secret.txt\n          -\u003e denied\n```\n","funding_links":[],"categories":["ftp"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobbydog%2Fsftp-sync-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdobbydog%2Fsftp-sync-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobbydog%2Fsftp-sync-deploy/lists"}