Skip to content

Tag: node.js

ssh2 node js sftp protocol Error Handshake failed

Hello i have a little problem, i developped a script sftp client with node js that connect to an sftp server and grab some files, i tested it with my local server its working, but when i tried to use it with production server i received this error : Error: Handshake failed: no matching key exchange algorithm …

How to convert node readable stream to RX observable

If I have a Node js stream, say for example from something like process.stdin or from fs.createReadStream, how can I convert this to be an RxJs Observable stream using RxJs5? I see that RxJs-Node has a fromReadableStream method, but that looks like it hasn’t been updated in close to a year. Answer For a…

Visual Studio Code: Run node script on save

I use Visual Studio Code (1.8.1) to write ECMAScript 6 for NodeJS 7.3 (so currently no TypeScript). I want to run the current script with node from the command line (node ${file}) every time the script file is saved. Is this possible? To be clear: NodeJS is not running as server, but used for executing cli sc…

fs.readdir ignore directories

I would like to scan the folder, but ignore all the folders/directories that are included in it. All I have in the (C:/folder/) are .txt files and other folders, I just want to scan the txt files, and ignore the folders. Answer Use fs.readdir or fs.readdirSync method with options { withFileTypes: true } and t…