1.2.49 • Published 3 months ago

@olzie-12/ftp-deploy v1.2.49

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

ftp deploy 🚀

Syncs a local folder with a remote folder over ftp.

After the initial sync only differences are synced, making deployments super fast!

Latest Stable Version NPM Downloads


How to Run

Option 1 - Run via command line

  • Install the npm package using npm install @olzie-12/ftp-deploy --only=dev
  • Run via command line ftp-deploy --server ftp.olziedev.com --username test@olziedev.com --password \"CrazyUniquePassword&%123\"

  • Or you can add a script to make deployments easier

  • Add a new key to your package.json file under scripts section. See example below.
  • You can run the script using the following command npm run deploy (run this in the folder that has the package.json file)

Example of package.json:

{
  "scripts": {
    "deploy": "ftp-deploy --server ftp.olziedev.com --username test@olziedev.com --password \"CrazyUniquePassword&%123\"",
  },
}

Option 2 - Run programmatically

  • Install the npm package using npm install @olzie-12/ftp-deploy --only=dev
  • Import the code and use it in your code

Example of myCustomDeployment.js:

import { deploy, excludeDefaults } from "@olzie-12/ftp-deploy";

async function deployMyCode() {
  console.log("🚚 Deploy started");
  await deploy({
    server: "ftp.olziedev.com",
    username: "username@olziedev.com",
    password: `CrazyUniquePassword&%123`, // note: I'm using backticks here ` so I don't have to escape quotes
    exclude: [...excludeDefaults, "dontDeployThisFolder/**"] // excludeDefaults will exclude .git files and node_modules
  });
  console.log("🚀 Deploy done!");
}

deployMyCode();

Automatically Deploying

If you use github as source control you can automatically re-deploy your site on every git commit. Read more


Settings

To list all commands with examples simply run ftp-deploy without any options.

Key NameRequiredExampleDefault ValueDescription
--serverYesftp.olziedev.comDeployment destination server
--usernameYesusername@olziedev.comftp username
--passwordYesCrazyUniquePassword&%123ftp password, be sure to escape quotes and spaces
--portNo99022Server port to connect to (read your web hosts docs)
--protocolNoftpsftpftp: provides no encryption, ftps: full encryption newest standard (aka "explicit" ftps), ftps-legacy: full encryption legacy standard (aka "implicit" ftps)
--local-dirNo./myFolderToPublish/./Path to upload to on the server, must end with trailing slash /
--server-dirNoftp.olziedev.com/./Folder to upload from, must end with trailing slash /
--state-nameNofolder/.sync-state.json.ftp-deploy-sync-state.jsonftp-deploy uses this file to track what's been deployed already, so only differences can be published. If you don't like the name or location you can customize it
--dry-runNotruefalsePrints which modifications will be made with current config options, but doesn't actually make any changes
--dangerous-clean-slateNotruefalseDeletes ALL contents of server-dir, even items marked as --exclude argument
--excludeNonuclearLaunchCodes.txt**/.git* **/.git*/** **/node_modules/**An array of glob patterns, these files will not be included in the publish/delete process
--log-levelNoinfoinfominimal: only important info, standard: important info and basic file changes, verbose: print everything the script is doing
--securityNostrictloosestrict: Reject any connection which is not authorized with the list of supplied CAs. loose: Allow connection even when the domain is not in certificate
--timeoutNo6000030000Timeout in milliseconds for FTP operations
1.2.41

3 months ago

1.2.42

3 months ago

1.2.40

3 months ago

1.2.45

3 months ago

1.2.46

3 months ago

1.2.43

3 months ago

1.2.44

3 months ago

1.2.49

3 months ago

1.2.47

3 months ago

1.2.48

3 months ago

1.2.23

3 months ago

1.2.24

3 months ago

1.2.22

3 months ago

1.2.27

3 months ago

1.2.28

3 months ago

1.2.25

3 months ago

1.2.26

3 months ago

1.2.29

3 months ago

1.2.30

3 months ago

1.2.31

3 months ago

1.2.34

3 months ago

1.2.35

3 months ago

1.2.32

3 months ago

1.2.33

3 months ago

1.2.38

3 months ago

1.2.39

3 months ago

1.2.36

3 months ago

1.2.21

1 year ago

1.2.20

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago