{"id":49735,"library":"websocket-sftp","title":"WebSocket-SFTP","description":"WebSocket-SFTP implements the SFTP protocol over WebSocket connections. Version 0.8.4 is current; development appears to be ongoing but with small community. Key differentiator: enables SFTP in browser environments where raw TCP is unavailable. Provides both client and server implementations with full TypeScript types. Important for projects needing file transfer over WebSockets, commonly used alongside websocketfs infrastructure.","status":"active","version":"0.8.4","language":"javascript","source_language":"en","source_url":"https://github.com/sagemathinc/websocketfs","tags":["javascript","sftp","server","client","ws","typescript"],"install":[{"cmd":"npm install websocket-sftp","lang":"bash","label":"npm"},{"cmd":"yarn add websocket-sftp","lang":"bash","label":"yarn"},{"cmd":"pnpm add websocket-sftp","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package ships ESM-only; CJS require requires .default or destructuring","wrong":"const WebSocketSFTPClient = require('websocket-sftp').WebSocketSFTPClient","symbol":"WebSocketSFTPClient","correct":"import { WebSocketSFTPClient } from 'websocket-sftp'"},{"note":"Named export, not default","wrong":"import WebSocketSFTPServer from 'websocket-sftp'","symbol":"WebSocketSFTPServer","correct":"import { WebSocketSFTPServer } from 'websocket-sftp'"},{"note":"Class is SFTPStream, not Stream","wrong":"import { Stream } from 'websocket-sftp'","symbol":"SFTPStream","correct":"import { SFTPStream } from 'websocket-sftp'"}],"quickstart":{"code":"import { WebSocketSFTPClient } from 'websocket-sftp';\nimport WebSocket from 'ws';\n\nconst ws = new WebSocket('wss://example.com/sftp');\nconst client = new WebSocketSFTPClient(ws);\n\nclient.on('ready', () => {\n  client.readdir('/', (err, list) => {\n    if (err) throw err;\n    console.log('Directory:', list);\n    client.end();\n  });\n});\n\nclient.on('error', (err) => console.error(err));","lang":"typescript","description":"Shows how to create a WebSocket SFTP client, connect, and list a directory."},"warnings":[{"fix":"Ensure WebSocket is provided either by environment or via 'ws' package.","message":"The library requires a WebSocket library (like 'ws') in Node.js; browser environment provides native WebSocket.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Update imports: `import { WebSocketSFTPClient } from 'websocket-sftp'` instead of `import WebSocketSFTPClient from 'websocket-sftp'`.","message":"Version 0.8.0 changed export structure from default to named exports.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Replace `SFTPWrapper` with `SFTPStream` in code.","message":"The `SFTPWrapper` class is deprecated in favor of `SFTPStream`.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Use a WebSocket wrapper that supports reconnection (e.g., 'reconnecting-websocket').","message":"The library does not handle WebSocket reconnection automatically; developers must implement reconnection logic.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.8.4':15 'alongsid':59 'appear':19 'browser':32 'client':41,65 'common':57 'communiti':26 'connect':13 'current':17 'develop':18 'differenti':28 'enabl':29 'environ':33 'file':53 'full':46 'implement':7,44 'import':49 'infrastructur':61 'javascript':62 'key':27 'need':52 'ongo':22 'project':51 'protocol':10 'provid':39 'raw':35 'server':43,64 'sftp':3,6,9,30,63 'small':25 'tcp':36 'transfer':54 'type':48 'typescript':47,67 'unavail':38 'use':58 'version':14 'websocket':2,5,12,56 'websocket-sftp':1,4 'websocketf':60 'ws':66","created_at":"2026-06-07T17:03:20.461567+00:00","updated_at":"2026-06-07T17:03:20.461567+00:00","problems":[{"fix":"Use named import: `import { WebSocketSFTPClient } from 'websocket-sftp'`","cause":"Using default import when package exports named exports.","error":"TypeError: WebSocketSFTPClient is not a constructor"},{"fix":"Install 'ws' and provide a WebSocket object: `import WebSocket from 'ws'`","cause":"Running in Node.js without providing a WebSocket implementation.","error":"Error: WebSocket is not defined"},{"fix":"Run `npm install websocket-sftp`","cause":"Package not installed or not in node_modules.","error":"Module not found: Can't resolve 'websocket-sftp'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sagemathinc/websocketfs#readme","github":"https://github.com/sagemathinc/websocketfs","docs":null,"changelog":null,"pypi":null,"npm":"websocket-sftp","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}