{"_id":"@akiroz/simple-ftpd","_rev":"5-4507d78b5d1969fc473a8582781d3fe8","name":"@akiroz/simple-ftpd","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.5":{"name":"@akiroz/simple-ftpd","version":"0.0.5","description":"simple ftp server","keywords":["ftp server","ftpd","ftp","file server"],"main":"index.js","repository":{"type":"git","url":"https://github.com/kamicane/simple-ftpd.git"},"author":{"name":"Valerio Proietti","email":"kamicane@gmail.com"},"license":"MIT","bin":{"ftp-server":"ftp-server"},"devDependencies":{"standard":"^8.6.0"},"dependencies":{"async-sequence":"^2.0.3","chalk":"^1.1.3","commander":"^2.9.0","fs-extra":"^2.0.0","moment":"^2.17.1","pump":"^1.0.2","sprintf":"^0.1.5","stat-mode":"^0.2.2"},"_id":"@akiroz/simple-ftpd@0.0.5","dist":{"shasum":"af0248b2167c7406fffef5bad726b869bcd6a194","integrity":"sha512-/Lty6oDtokNXGwyQfkC+3uwzhkukBZYNT1de/hdHDjGhPNj0bx2xU2SN0UbDkgbKFNHhmPC4qpIikU7j6lOypA==","tarball":"https://registry.npmjs.org/@akiroz/simple-ftpd/-/simple-ftpd-0.0.5.tgz","fileCount":30,"unpackedSize":34794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeZPaCRA9TVsSAnZWagAA7scP/3GbaYb5Hi69THjXS3hE\n+y7ivpBvQiKVCjjnfoX/9EV5wbqh4NL4ZAHcKEFLunxfp29e1B5Ic+Ud53f1\n2Q3MdLPmkWoPF2L1FwSNCIPs4M8/4nGWwRwoNYZj+aCFoI+XnysHrKTBVoyK\nZNzjoy/6QAvMA6cFuMHlO5QeTfr2HvYiN2qFtYc0J3cuv8NqpT1DlpsG4yJh\nff8SHU5nlM9Uv9RvsuWI/HOeVlhOisqE89zude0tqWbfacMbIPSWrEeXM7kw\nhKK1IqIJDKYBarV0a2sDkqziokAnPoFwv7rztxGdOz2B1Ihdhi2Cv1cCkk29\nUEyhZ0z0jqQyVAIICYW3qxlR/I19ZpEsqzkBLcTu3jwS8d+HK2gftGS7DRv/\n/n8YQG219lVVK/ESZ345fo+tYEGLVbZVBXwwFz+fZnXviwZE0iS7I6Mp5+7D\n/i6XXDIBRqkFNVlGEhYdsJYB+58RWFodLcMw9f4la1Hy7cpoLGKbuFLNHWtg\nF/kj+kBb73YmW+hhyA+cO7LprLP/dQVRvjBycrJVggT57Z1pZDvotQWFf/7Y\ngmAGK4btTwey/ybAtWyE1o28XeU/6yfOBwdr+696lq5EzZzG3zM/T0dQsWS0\n4BRnBDjPxXEvAjzMHSPzD8/PGQvRJAxqLeXNr8CxhvV4J34odeu3m4ltfFDY\nnx+R\r\n=ihYp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDiCstDhnMGTJVvaWh0Feu+fAoEC7MM1TGYE4cler5UMAiAS63oMOK7uwXmPgVDFfkzn7u+9hP4gxQxsd2BuO60glw=="}]},"_npmUser":{"name":"akiroz","email":"akiroz.vectis@gmail.com"},"directories":{},"maintainers":[{"name":"akiroz","email":"akiroz.vectis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simple-ftpd_0.0.5_1618580441796_0.45339713523665637"},"_hasShrinkwrap":false},"0.0.6":{"name":"@akiroz/simple-ftpd","version":"0.0.6","description":"simple ftp server","keywords":["ftp server","ftpd","ftp","file server"],"main":"index.js","repository":{"type":"git","url":"https://github.com/kamicane/simple-ftpd.git"},"author":{"name":"Valerio Proietti","email":"kamicane@gmail.com"},"license":"MIT","bin":{"ftp-server":"ftp-server"},"devDependencies":{"standard":"^8.6.0"},"dependencies":{"async-sequence":"^2.0.3","chalk":"^1.1.3","commander":"^2.9.0","fs-extra":"^2.0.0","moment":"^2.17.1","pump":"^1.0.2","sprintf":"^0.1.5","stat-mode":"^0.2.2"},"_id":"@akiroz/simple-ftpd@0.0.6","dist":{"shasum":"646ac7a59dc82d3e3b43ad3b6dc3733b9df082c2","integrity":"sha512-XQQy+QwFMH/T90Xq8Oc6vySB2Tsko1cEWFveNa7Ex83CBlcsnzFHQ/+/RA3bQeuQWwjmvxelEO3r3VTASV00qQ==","tarball":"https://registry.npmjs.org/@akiroz/simple-ftpd/-/simple-ftpd-0.0.6.tgz","fileCount":30,"unpackedSize":34794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeZW8CRA9TVsSAnZWagAA3rQP/RxHggx5cjMxVf1AY6Ix\nrce4LOPe6cC4EiQVBowTItsz9IxgCUUNvLSnxJKGqw/gnTzNLXjM+AedPDHb\nMnfW0+v/GdY7Hj5jdjuoE6WwuAR4+0liL3d2OGLC612H+wGaoKhkfWHQhCHz\nraEYURPuEhycrgS3HPxiwDGRno6fADt4sdtwr+vG42mljH6iI1LqBvC2Dgcx\nbOISkahl21btb2nSUGFtyn8m9C0Xd4oYo+L4whQ2pSn8Mhe8XIZl/Im+81ZL\nq4kNe9mD/DDeSBX5tDKf9ACR3nKUacPDEsOw8k8qUUdlqCApQIULrUJx9IZV\niF9i6IhVsqi1TRDkbQi8U8NrMoazFqyLGxR6LRCsW5jAwI97mT7lcBfDajWz\nuoXRsjymzkEL3S9V1Ds2PWagA+Qm4NMS8g72o9x72pnCrvbHLhRitZuaRkRl\nW85W4XcOlhRI96Akc5ckeZSGkMRFmQFwdPyYMgKE0J7Q/ek99Cf2Ztye5H4s\n7jERLUYRePvu8qmR1q0Mmo1BkuAv53p2jLiS7a2zNV7a7M/cE8pi9a2Xcge2\nN0Iy6tE+RuI0UTf3xX7fiItkxUqV7325k6CASmBYQe7w/UG72B/hdWDDbPth\nkA/qiyFg+809PRG5U6ANtTbPlrpCZDpPbtYu42v62bRP0VVvllaBnkhkQS3k\nu8zd\r\n=pVV7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErZEQxqwQUqmHyMLqPjJsVY2H0+63Ft8yoRvbOmrOABAiAidu6po7cx0tcnKRHJu838xxalSw4G3Uy4aXKhwup2KA=="}]},"_npmUser":{"name":"akiroz","email":"akiroz.vectis@gmail.com"},"directories":{},"maintainers":[{"name":"akiroz","email":"akiroz.vectis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simple-ftpd_0.0.6_1618580924211_0.6221904043475948"},"_hasShrinkwrap":false},"0.0.7":{"name":"@akiroz/simple-ftpd","version":"0.0.7","description":"simple ftp server","keywords":["ftp server","ftpd","ftp","file server"],"main":"index.js","repository":{"type":"git","url":"https://github.com/kamicane/simple-ftpd.git"},"author":{"name":"Valerio Proietti","email":"kamicane@gmail.com"},"license":"MIT","bin":{"ftp-server":"ftp-server"},"devDependencies":{"standard":"^8.6.0"},"dependencies":{"async-sequence":"^2.0.3","chalk":"^1.1.3","commander":"^2.9.0","fs-extra":"^2.0.0","moment":"^2.17.1","pump":"^1.0.2","sprintf":"^0.1.5","stat-mode":"^0.2.2"},"_id":"@akiroz/simple-ftpd@0.0.7","dist":{"shasum":"3b5a6c805ccfec28917bc49907c389b656d9708a","integrity":"sha512-bGGk0px9FCvzBgCExHgGn4U0E4tef1hGnFvzi6tEhVkm/ojOZmmxFD0Ha7JkPJ3owQn99L3TMSZnU+a3chu5Lg==","tarball":"https://registry.npmjs.org/@akiroz/simple-ftpd/-/simple-ftpd-0.0.7.tgz","fileCount":30,"unpackedSize":34822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeZhRCRA9TVsSAnZWagAAPVwP/0RLjP6bEdVZXLtWxRpz\nOmTgS8okyXiyJ0nXhjs2xmTM6RVdhfUUlAmeqd7pV7IG4Dor9pXrv7nVmamF\nS4MxOtxkBtLt4HSGGTw+HTXvI64a5ias7SFu4K0O8jcpxbjTjY1PAAnX+WSC\nta4C7SHsuikLUL8/OdNhVLqnYTZXZauvHtdjQSY1QANrGye+YdmVJaQkJ2lz\niAb2GFxIaoCUusvPZgHmAWzJhSTcauthhr/pqEezEgRtTEz9qchiBvUhIl4L\nkAf+06/zt02diwW92X5Rft04ICSE9CaCkCoyfmPIHMNDQiSBmWNBMnIgvyLR\nzqp+SlrLaho0AiXT63FXas/ORbihki6i6l8S+lGTHizYWL7UBA9SpaEmeBCN\nWhA5c/xnfLW8c+OFeLF72SbygfdAhdszrRPx9TQdJ4Iq0H3mhn/gXDTmajQc\nyw8WAvZFVlgt7MveZAoLGFXvUgfb7OPDEE5zWS7cV1HHk/K4ZhMbvp9qU1N0\nbUkDPwKPbj3hrcXyK4ut/z3imz59z8xycFl0WYdenWHfr8x6lcICI600xGfe\n3Cmwy/UNnEOGt9ZXt2lJ22QARoSvBrnqtaNI6hqlBvOFr3AfP8oaBEZ/WQKy\nG9V1/GoqZv3r/9CkBuvVuhzar8bZpclmMpdeUIYv5EODsoZn/B+XAs/34zzI\nvnoJ\r\n=tNd1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjgXP4N8PNPk9YB1uSy4nzTXZ1Lp29b+80mWGMAgkxiAiBxGGRxntCE9ZPmRwVDmY5NyJoQB+IK873BWOrkPGgyyQ=="}]},"_npmUser":{"name":"akiroz","email":"akiroz.vectis@gmail.com"},"directories":{},"maintainers":[{"name":"akiroz","email":"akiroz.vectis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simple-ftpd_0.0.7_1618581584654_0.9425180741261097"},"_hasShrinkwrap":false},"0.0.8":{"name":"@akiroz/simple-ftpd","version":"0.0.8","description":"simple ftp server","keywords":["ftp server","ftpd","ftp","file server"],"main":"index.js","repository":{"type":"git","url":"https://github.com/kamicane/simple-ftpd.git"},"author":{"name":"Valerio Proietti","email":"kamicane@gmail.com"},"license":"MIT","bin":{"ftp-server":"ftp-server"},"devDependencies":{"standard":"^8.6.0"},"dependencies":{"async-sequence":"^2.0.3","chalk":"^1.1.3","commander":"^2.9.0","fs-extra":"^2.0.0","moment":"^2.17.1","pump":"^1.0.2","sprintf":"^0.1.5","stat-mode":"^0.2.2"},"_id":"@akiroz/simple-ftpd@0.0.8","dist":{"shasum":"8fb77d5402304f2a2c02bbd7f3496898fb9a0fb7","integrity":"sha512-ZFIkJac6fxEfQfMrOQbLrUHFNHhT1gzo7MR5GzI/ECn2lOM7gWBoC09sNPErn4QL1f30yYAGFq3XqIrqxW4HCA==","tarball":"https://registry.npmjs.org/@akiroz/simple-ftpd/-/simple-ftpd-0.0.8.tgz","fileCount":30,"unpackedSize":34823,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeZl2CRA9TVsSAnZWagAADU4P/RqZCGYDa8fxJlnb+yFH\nb5rqL0czHdJLT1WXliLMWzMgBj+6398LC7ThloLR7uYVB2Rg46c0cvxBWeI+\nMBxzDdov9R5lCozwWs1yFy1U7AG/gTzbTaZoc+hecekQ9AgjkWFuT8RH0chY\nNlgAAE7eeTKRoMqzGlheVij9ZHuab1jMbRo+v3YlFxq+zuUMwp3SDEGsvgIT\nJqcQZvchqG+4AW+5xm0+znPxPqnh1iglYf1MhHVFBSYfPDZj4xELiuTjFh6p\ntJWtJd7uuE2d6LB1RpjZGdf8SSxbc5Hw96WWHr6AKUI0kfzXhzGdMe1Lde9j\nSOYS1wZW9xq3wBOHmA55GtYwfeHnetCAQTRy96vD8ExayCpN62ZX5I63+KhK\nlNw5XaIYm/E2bzHDdB4zYCzEyWx0x/U1yMkttIOthQCDW4NdDddT1ZGWtm/j\npQ6c8yabgUQfKywgxISfnWIBLoYL/au+turha6FCht7fo3zywph9r6EtLb+u\nSSbymbE/xw1xGvW8vQlG/C09iV6inwmLMvMYMtfPQCgImI9kh+U+tbhQNlvT\nW6Kir6I2JEas/HYtX/ei50F+vNpTkQ7wFmuVFNIUsF4ue02HglMbPaSnuJQn\n3IBnGer3AW/hbRiki6nVgvbb0e3G50cPKGWXyKB/RVv2XtcJNlZ46bANyL1u\n3uJM\r\n=ygU8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqRdooZtZfdLdhlzQjZKcuKYCDu0QtZaRgoYFyaf3UigIgMBMYPhb5XLmAC8am2vr/N3x+6p3Q2/sFzker6N/mX7A="}]},"_npmUser":{"name":"akiroz","email":"akiroz.vectis@gmail.com"},"directories":{},"maintainers":[{"name":"akiroz","email":"akiroz.vectis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simple-ftpd_0.0.8_1618581878023_0.14041572665855084"},"_hasShrinkwrap":false},"0.0.9":{"name":"@akiroz/simple-ftpd","version":"0.0.9","description":"simple ftp server","keywords":["ftp server","ftpd","ftp","file server"],"main":"index.js","repository":{"type":"git","url":"https://github.com/kamicane/simple-ftpd.git"},"author":{"name":"Valerio Proietti","email":"kamicane@gmail.com"},"license":"MIT","bin":{"ftp-server":"ftp-server"},"devDependencies":{"standard":"^8.6.0"},"dependencies":{"async-sequence":"^2.0.3","chalk":"^1.1.3","commander":"^2.9.0","fs-extra":"^2.0.0","moment":"^2.17.1","pump":"^1.0.2","sprintf":"^0.1.5","stat-mode":"^0.2.2"},"_id":"@akiroz/simple-ftpd@0.0.9","dist":{"shasum":"c6a09458b3d003f37800a8626caf871ae4c72a9d","integrity":"sha512-wYyT79HakBDXlTBcoHs1YN6aIJRrf6fd60iUjiiBOHY4LL619NZRQPimn8V8FBVQSNvh//dQFLlz+mUxEQgn/w==","tarball":"https://registry.npmjs.org/@akiroz/simple-ftpd/-/simple-ftpd-0.0.9.tgz","fileCount":30,"unpackedSize":34821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgelteCRA9TVsSAnZWagAA/+sP/2vSwXxcDPax+wgLLXrI\nznVRzkVwf6hQoOcrd6fCS1KjBELrcxn4GyGsvfq2veuqE2wIaTYAsskIn6a/\natAJH/U3a3UNzIY72CLPF/7Q4D0iqsVLVzS0y7sJyU95xF2snOqLQQGldc1i\nklQQMAKPnaDd9XHHy0TtkCWsdhkP19+9SF5eiOtE4GptmNA8GKaT3SYXYQUM\nwoX7qC2YLbDmevdnyb4Dp1y7lbmsJ9oj4g9kB2slB4DIxRUNcCksq6hjo4Q0\nI3z71854gwQhoaBwckmY+YNipum4fjnMlqfDGhzCIeQJYwxFu4f1M6PCsr2J\nWIddJx+jGyYKyuIJhiB0n50yFhKtpoMbgzn6lLx9+Nu8Nb9UXwPW9zc93rIu\nzA7fiJOdu9snnQKCWsPUZSWdIzz3Gg9HxsZlYPWuLRg1sJt0ivPoRN9uPtbi\nCKXbwS9IPCy4uYx+B5dVzrFBcV0ETUgm9bitgrGLz3HdjRpqVMXzd+oCYi9h\nZmaItttNWur9vI2T3DQ2cs3hfgcgfq6zGlLBqP17P67qYVfzA4pb+I1alJvR\nW7Ia+gv0UHKT62G6pb5Yk9QUT281bHrnJ+v67AAV/NTZW0AE9RZR2K7xkpmt\nC8EFu1yy6DhUIzUFtqaIkZlBPebyVJDb0DQDHbKnCTuiOMVhGdRnOUbrARf1\ndURV\r\n=S103\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC58VQlAa9jR9Vl8akKog7UDBfVPEfb7nWCbyOaYossowIhAJlhxco/erc3D77d+mot5wY2PneVJjmx96FockgMImVM"}]},"_npmUser":{"name":"akiroz","email":"akiroz.vectis@gmail.com"},"directories":{},"maintainers":[{"name":"akiroz","email":"akiroz.vectis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simple-ftpd_0.0.9_1618631518173_0.8417180585149859"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-16T13:40:41.759Z","0.0.5":"2021-04-16T13:40:41.919Z","modified":"2022-04-04T12:29:46.141Z","0.0.6":"2021-04-16T13:48:44.360Z","0.0.7":"2021-04-16T13:59:44.791Z","0.0.8":"2021-04-16T14:04:38.137Z","0.0.9":"2021-04-17T03:51:58.290Z"},"maintainers":[{"name":"akiroz","email":"akiroz.vectis@gmail.com"}],"description":"simple ftp server","keywords":["ftp server","ftpd","ftp","file server"],"repository":{"type":"git","url":"https://github.com/kamicane/simple-ftpd.git"},"author":{"name":"Valerio Proietti","email":"kamicane@gmail.com"},"license":"MIT","readme":"# simple-ftpd\n\n`simple-ftpd` is a event based ftp-server for node.js.\n\n## Features\n\n- Supports multiple modern ftp clients such as FileZilla, WinSCP, Transmission.\n- A real File System is not required.\n- For now it only supports basic authentication.\n- It supports passive mode only.\n- It only supports streams for writing and reading files.\n- It currently only supports a subset of FTP commands, but it should be enough for any modern FTP client.\n- It is intended to be used mainly to create local network ftp servers.\n\nUsed [pyftpdlib](https://github.com/giampaolo/pyftpdlib) extensively as a reference for the FTP protocol specification, as reading RFC documents is super boring :=)\n\n## Install\n\n```sh\nyarn add simple-ftpd\n# or\nnpm install simple-ftpd --save\n```\n\n```js\nconst ftpd = require('simple-ftpd')\n```\n\n## API\n\nSyntax: `ftpd(opts, sessionCallback)` or `ftpd(host:port, sessionCallback)`\n\nShould you need more control, the `ftpd` function will return a [`net.Server`](https://nodejs.org/api/net.html#net_class_net_server) instance.\n\n## Example\n\nSimple, fs-based ftp server implementation example:\n\n```js\n'use strict'\n\nconst ftpd = require('simple-ftpd')\n\nftpd({ host: '127.0.0.1', port: 1337, root: '/public/files' }, (session) => {\n\n  session.on('pass', (username, password, cb) => {\n    if (username === 'superadmin' && password === '53cr3t') {\n      session.readOnly = false\n      session.root = '/private/secret/files'\n      cb(null, 'Welcome admin')\n    } else {\n      cb(null, 'Welcome guest')\n    }\n  })\n\n  session.on('stat', fs.stat)\n  // AKA\n  // session.on('stat', (pathName, cb) => {\n  //  fs.stat(pathName, cb)\n  // })\n\n  session.on('readdir', fs.readdir)\n  // AKA\n  // session.on('readdir', (pathName, cb) => {\n  //   fs.readdir(pathName, cb)\n  // })\n\n  session.on('read', (pathName, offset, cb) => {\n    cb(null, fs.createReadStream(pathName, { start: offset }))\n  })\n\n  session.on('write', (pathName, offset, cb) => {\n    cb(null, fs.createWriteStream(pathName, { start: offset }))\n  })\n\n  // I'd do some checking if I were you, but hey.\n\n  session.on('mkdir', fs.mkdir)\n  session.on('unlink', fs.unlink)\n  session.on('rename', fs.rename)\n  session.on('remove', require('rimraf'))\n})\n```\n\n## Options\n\n| option | | description |\n| --- | --- | --- |\n| `host` | required | Must be a valid ipv4 address (for now). Defaults to `127.0.0.1` |\n| `port` | required | Server port. Defaults to `1337`. |\n| `readOnly` | optional | Disables client write requests. Defaults to `true`. Can be overridden on a connection-basis by setting the readOnly property on the session object before logging in. |\n| `root` | optional | The path passed to events will always be joined to `root`. Can be overridden on a connection-basis by setting the root property on the session object before logging in. The ftp client will not see `root`, and will think he's at `/`. This is simply a convenience to avoid manually joining the path you get in every event. |\n| `maxConnections` | optional | Maximum number of server connections. Defaults to 10. |\n\nPassive connections will be initialized on an unused port assigned by the os.\n\nInstead of options, you can pass `${host}:${port}` (`\"192.168.1.10:1337\"`).\n\n## Events\n\nEvery event gets some arguments and a node-style callback you must call with an Error object (if any) and results.\n\nIf you do not listen to a specific event, then that feature will become unavailable to the client.\nFor example, if you do not listen to `write` events, the client will get a 502 error when trying to write files.\n\n### `pass [username, password, cb]`\n\nThe client wants to login with `username` and `password`.\nWill consider the user logged in if no error is passed to `cb()`\n\nUser names are always accepted, because (from pyftpdlib):\n\n> In order to prevent a\n> malicious client from determining valid usernames on a server,\n> it is suggested by RFC-2577 that a server always return 331 to\n> the USER command and then reject the combination of username\n> and password for an invalid username when PASS is provided later.\n\n### `read [pathName, offset, cb]`:\n\nThe client wants to read the file at `pathName`, starting at `offset`.\nRequires a readable stream to be passed as `cb(null, readStream)`.\n\n### `write [pathName, offset, cb]`:\n\nThe client wants to write a file at `pathName`, starting at `offset`.\nRequires a writable stream to be passed as `cb(null, writeStream)`.\n\n### `stat [pathName, cb]`:\n\nthe client wants the stats to a file or directory at `pathName`.\nRequires a `fs.stat`-like object to be passed as `cb(null, stat)`.\n\nProperties are:\n\n```js\n{\n  // fs.stat mode\n  mode: 16822,\n  //  size in bytes\n  size: 12345,\n  // lastModifiedTime as Date or number (or whatever gets parsed by moment)\n  mtime: Date.now(),\n  // optional, will use it for display if available, otherwise \"owner\"\n  uname: 'kamicane',\n  // optional, will use it for display if available, otherwise \"group\"\n  gname: 'admins',\n}\n```\n\n### `readdir [pathName, cb]`:\n\nThe client wants a list of files in the directory `pathName`. requires an array of file names, relative to pathName, to be passed as `cb(null, list)`.\n\n### `mkdir [pathName, cb]`:\n\nThe client wants to create a directory at `pathName`.\nWill consider the directory written if no error is passed to `cb()`\n\n### `unlink [pathName, cb]`:\n\nThe client wants to delete the file at `pathName`.\nWill consider the file deleted if no error is passed to `cb()`\n\n### `remove [pathName, cb]`:\n\nThe client wants to remove a directory, and all of its contents, at `pathName`.\nWill consider the directory and its contents removed if no error is passed to `cb()`\n\n### `rename [fromName, toName, cb]`:\n\nThe client wants to rename a file or directory, from `fromName` to `toName`.\nWill consider the file renamed if no error is passed to `cb()`\n\n## CLI\n\nWhen installed globally, ftpd will provide a small cli, which will quickly create a fs-based ftp server.\n\nYou can use it like this:\n\n```sh\nftp-server /public/files --host 192.168.0.1 --port 1234 --max-connections 10\n```\n\n* `--host` will default to `127.0.0.1`\n* `--port` will default to `1337`\n* `--max-connections` will default to `10`\n* `--read-only` will default to `true`\n* Unless specified, the ftp root will default to `process.cwd()`\n\nThe cli will accept any login, so be careful when setting `--read-only` to `false`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}