Qusly-Core is a powerful multi-protocol library for file transfer. Created for Qusly.
Features
Example
import { Client } from 'qusly-core';
async function main() {
const client = new Client({ pool: 2 });
await client.connect({
protocol: 'ftp',
host: 'www.example.com',
user: 'root',
password: 'password',
});
const [documents, videos] = await Promise.all([
client.list('/documents'),
client.list('/videos'),
]);
console.log(document, videos);
await client.disconnect();
}
main();
Installation
$ npm install qusly-core
Components
We use ssh2 and basic-ftp under the hood.
Task queue
Certain protocols such as ftp
don't support handling many request at the same time. When app calls API many times from many places, handling manually these cases is very hard - you can't use await
in the most cases.
What if you want to use many connections to speed up transfering files?
That's where we come in. This library supports it all thanks to the powerful task manager.
Connection pool
Allows you to:
- Use all connections for every method
- Use one connection to generic methods e.g. listing files and the rest for transfering files