Updated README

This commit is contained in:
2021-06-02 00:23:26 -05:00
parent 534c311dac
commit 52976ac88b

View File

@@ -79,6 +79,9 @@ const conn = await rep.create_pool(8, MY_HOST_OR_IP, MY_PORT, MY_TOKEN);
const conn = await rep.connect(MY_HOST_OR_IP, MY_PORT, MY_TOKEN); const conn = await rep.connect(MY_HOST_OR_IP, MY_PORT, MY_TOKEN);
*/ */
/* Disconnect when complete
await conn.disconnect();
*/
//************************************************************************************************// //************************************************************************************************//
// Step 2. Create an 'api' instance using the connection pool / connection // // Step 2. Create an 'api' instance using the connection pool / connection //
@@ -95,6 +98,9 @@ const api = rep.create_api(conn);
// *********** Directory Operations *********** // // *********** Directory Operations *********** //
//------------------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------//
// Check if directory exists
const exists = await api.directory.exists('/my_directory');
// List directory contents // List directory contents
await api.directory.list('/', async (remote_path, page_count, get_page) => { await api.directory.list('/', async (remote_path, page_count, get_page) => {
for (let i = 0; i < page_count; i++) { for (let i = 0; i < page_count; i++) {
@@ -127,6 +133,9 @@ await api.directory.remove('/test')
// *********** File Operations *********** // // *********** File Operations *********** //
//------------------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------//
// Check if file exists
const exists = await api.file.exists('/my_file.txt')
// Delete a file // Delete a file
await api.file.delete('/my_file.txt') await api.file.delete('/my_file.txt')