{"id":29720730,"url":"https://github.com/sheikhaminul/fs-tunnel","last_synced_at":"2026-03-17T15:31:41.752Z","repository":{"id":305925911,"uuid":"1006654490","full_name":"SheikhAminul/fs-tunnel","owner":"SheikhAminul","description":"Modern SSH/SFTP file system client for Node.js - provides seamless remote file operations with a clean Promise-based API. Supports secure file transfers, directory management, and streaming for large files.","archived":false,"fork":false,"pushed_at":"2025-06-22T18:20:26.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T08:16:02.141Z","etag":null,"topics":["filesystem","fs","remote-filesystem","sftp","ssh","ssh-tunnel"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fs-tunnel","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/SheikhAminul.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,"zenodo":null}},"created_at":"2025-06-22T18:20:20.000Z","updated_at":"2025-06-22T18:23:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"122ff273-3cd5-42a6-b146-1031c046c45c","html_url":"https://github.com/SheikhAminul/fs-tunnel","commit_stats":null,"previous_names":["sheikhaminul/fs-tunnel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SheikhAminul/fs-tunnel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheikhAminul%2Ffs-tunnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheikhAminul%2Ffs-tunnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheikhAminul%2Ffs-tunnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheikhAminul%2Ffs-tunnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SheikhAminul","download_url":"https://codeload.github.com/SheikhAminul/fs-tunnel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SheikhAminul%2Ffs-tunnel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30626814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: 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":["filesystem","fs","remote-filesystem","sftp","ssh","ssh-tunnel"],"created_at":"2025-07-24T13:42:05.434Z","updated_at":"2026-03-17T15:31:41.725Z","avatar_url":"https://github.com/SheikhAminul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSH/SFTP File System Client\n\n[![NPM Version](https://img.shields.io/npm/v/fs-tunnel.svg?branch=main)](https://www.npmjs.com/package/fs-tunnel)\n[![Publish Size](https://badgen.net/packagephobia/publish/fs-tunnel)](https://packagephobia.now.sh/result?p=fs-tunnel)\n[![Downloads](https://img.shields.io/npm/dt/fs-tunnel)](https://www.npmjs.com/package/fs-tunnel)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/SheikhAminul/fs-tunnel/blob/main/LICENSE)\n================\n\n### Modern SSH/SFTP client for Node.js\nA robust TypeScript library providing seamless file system operations over SSH/SFTP with a clean, promise-based API. Perfect for secure file transfers, remote server management, and automation tasks.\n\n## Table of Contents\n\n* [Installation](#Installation)\n* [Usage](#usage)\n* [API Reference](#api-reference)\n* [Contributing](#contributing)\n* [License](#license)\n* [Author](#author)\n\n## Installation\n\n```bash\nnpm install fs-tunnel\n```\n\n## Usage\n\n### Basic example\n```typescript\nimport { SSHFileSystem } from 'fs-tunnel'\n\nconst config = {\n  host: 'example.com',\n  port: 22,\n  username: 'user',\n  password: 'password'\n}\n\nasync function main() {\n  const fs = new SSHFileSystem(config)\n  \n  try {\n    await fs.connect()\n    \n    // List files in directory\n    const files = await fs.readdir('/remote/path')\n    console.log('Directory contents:', files)\n    \n    // Get file stats\n    const stats = await fs.stat('/remote/file.txt')\n    console.log('File stats:', stats)\n    \n    // Download file\n    const readStream = fs.createReadStream('/remote/file.txt')\n    readStream.pipe(fs.createWriteStream('./local-file.txt'))\n    \n  } finally {\n    fs.disconnect()\n  }\n}\n\nmain()\n```\n\n### Advanced example\n```typescript\n// Upload directory recursively\nasync function uploadDirectory(localPath, remotePath) {\n  const items = await fs.promises.readdir(localPath, { withFileTypes: true })\n  \n  await fs.mkdir(remotePath)\n  \n  for (const item of items) {\n    const localItemPath = path.join(localPath, item.name)\n    const remoteItemPath = path.posix.join(remotePath, item.name)\n    \n    if (item.isDirectory()) {\n      await uploadDirectory(localItemPath, remoteItemPath)\n    } else {\n      const readStream = fs.createReadStream(localItemPath)\n      const writeStream = fs.createWriteStream(remoteItemPath)\n      readStream.pipe(writeStream)\n    }\n  }\n}\n```\n\n## API Reference\n\n### Class: SSHFileSystem\n\n#### Constructor\n```typescript\nnew SSHFileSystem(config: SSHConfiguration)\n```\n- `config`: Connection configuration object\n  - `host`: Server hostname (required)\n  - `port`: SSH port (required)\n  - `username`: Authentication username\n  - `password`: Authentication password\n\n#### Methods\n\n| Method | Description |\n|--------|-------------|\n| `connect()` | Connects using configured credentials |\n| `connectWithCredentials(username, password)` | Connects with explicit credentials |\n| `readdir(path)` | Lists directory contents |\n| `stat(path)` | Gets file/directory stats |\n| `mkdir(path)` | Creates a directory |\n| `rmdir(path)` | Removes a directory |\n| `unlink(path)` | Deletes a file |\n| `rename(oldPath, newPath)` | Renames/moves a file |\n| `createReadStream(path)` | Creates readable file stream |\n| `createWriteStream(path, options)` | Creates writable file stream |\n| `disconnect()` | Closes the connection |\n\n### Interfaces\n\n#### `FileInfo`\n```typescript\n{\n  name: string\n  isDirectory: boolean\n  size: number\n  mtime: Date\n  mode: number\n}\n```\n\n#### `StatInfo`\n```typescript\n{\n  isDirectory: boolean\n  size: number\n  mtime: Date\n  mode: number\n}\n```\n\n#### `SSHConfiguration`\n```typescript\n{\n  host: string\n  port: number\n  username?: string\n  password?: string\n}\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on the [GitHub repository](https://github.com/SheikhAminul/fs-tunnel).\n\n## License\n\nfs-tunnel is licensed under the [MIT license](https://github.com/SheikhAminul/fs-tunnel/blob/main/LICENSE).\n\n\n## Author\n\n|[![@SheikhAminul](https://avatars.githubusercontent.com/u/25372039?v=4\u0026s=96)](https://github.com/SheikhAminul)|\n|:---:|\n|[@SheikhAminul](https://github.com/SheikhAminul)|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheikhaminul%2Ffs-tunnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheikhaminul%2Ffs-tunnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheikhaminul%2Ffs-tunnel/lists"}