Skip to content

nitti87/JSftp-simplify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSftp-simplify

This class will help you do more complex things with jsftp.

What can you do?

You can:

  • Create a folder with subfolders
  • Remove a folder and its' subfolders/files
  • Remove a single file
  • Get the list-information of a folder using ls
  • Renaming a folder or a file
  • Cut a file to a directory


How to install?

1. Install jsftp: npm i jsftp
2. Download the file jsftp_simplify.js
3. Change this.config in the constructor() function so it point to your server
4. Require jsftp_simplify: const jsftp_simplify = require('path/to/jsftp_simplify');

How to use

Creating a new folder:
jsftp_simplify.makeDir('folderName')

Creating a new folder or an existing folder with subfolders:
jsftp_simplify.makeDir('folderName/subfolderName/subfolderName')

Removing a folder and its' subfolders/files:
jsftp_simplify.removeDir('path/to/folderName')


Removing a single file:
jsftp_simplify.removeFile('path/to/fileName')


Get the list-information of a folder:
jsftp_simplify.ls('path/to/folderName')
Returns an array of objects containing {name: string, size: Number, isFolder: boolean}


Renaming a folder or a file:
jsftp_simplify.rename({ path: 'path/to/folderOrFilename', name: 'newName' })



Cut a file to a directory:
jsftp_simplify.xcopy({ from: 'path/to/fileName', to: 'new/path' })

Importrtant

Some functions are not implemented (e.g. upload, download). Feel free to implement new functions. I'll not add new feature, however, if any issue occur I'll try to fix them. If you have any questions about JSftp-simplify, just pm me!

License

See License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published