https://github.com/artskydj/ftp-basic-user-pass
Extension for the ftp-core, handling USER and PASS commands, reading from a JSON file.
https://github.com/artskydj/ftp-basic-user-pass
Last synced: 8 months ago
JSON representation
Extension for the ftp-core, handling USER and PASS commands, reading from a JSON file.
- Host: GitHub
- URL: https://github.com/artskydj/ftp-basic-user-pass
- Owner: ArtskydJ
- Created: 2015-01-29T04:26:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-29T14:13:30.000Z (about 11 years ago)
- Last Synced: 2025-03-12T05:29:52.687Z (about 1 year ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ftp-basic-user-pass
===================
Builds on top of the [ftp-core](https://github.com/sdmp/ftp-core).
#install
```
npm install ftp-basic-user-pass
```
#examples
###hard coded object
server.js
```js
var Ftp = require('ftp-core')
var FtpUserPass = require('ftp-basic-user-pass')
var Socket = require('ftp-normal-sockets')
var myFtp = new Ftp()
.extend(FtpUserPass({
joseph: '12345',
friends: 'lol insecure'
}))
.extend(Socket({ listen: 21 }))
```
###from JSON file
auth.json
```json
{
"joseph": "12345",
"friends": "lol insecure"
}
```
server.js
```js
var Ftp = require('ftp-core')
var FtpUserPass = require('ftp-basic-user-pass')
var Socket = require('ftp-normal-sockets')
var userPassMap = require('./auth.json')
var myFtp = new Ftp()
.extend(FtpUserPass(userPassMap))
.extend(Socket({ listen: 21 }))
```
#todo
- [ ] add tests
- [ ] in the docs, talk a bit about how ftp-core extensions work
#license
[VOL](http://veryopenlicense.com)