fast-web-deployment 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # Fast Web Deployment
2
+
3
+ A fast and easy-to-use web deployment tool for Node.js projects with SSH support.
4
+
5
+ ## Features
6
+
7
+ - 🚀 **Fast Deployment**: Deploy your web projects quickly via SSH
8
+ - 📦 **Multiple Formats**: Support for both tar and zip compression
9
+ - 🔐 **Secure**: Support for both password and private key authentication
10
+ - 📝 **YAML Configuration**: Easy configuration using YAML files
11
+ - 🎯 **Interactive**: User-friendly command-line interface
12
+ - 📦 **Compressed Output**: Automatically generates gzip compressed files for faster downloads
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install fast-web-deployment
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ### Basic Usage
23
+
24
+ ```javascript
25
+ import { publishToSsh } from 'fast-web-deployment';
26
+
27
+ // Deploy using YAML configuration
28
+ const publisher = publishToSsh('./dist', 'my-project', false);
29
+ await publisher.yamlMethod('./config.yml');
30
+
31
+ // Or deploy using options
32
+ const publisher = publishToSsh('./dist', 'my-project', true);
33
+ await publisher.optionsMethod({
34
+ host: 'your-server.com',
35
+ port: 22,
36
+ username: 'username',
37
+ password: 'password',
38
+ method: 'password',
39
+ sshPublishDirectory: '/var/www/html'
40
+ });
41
+ ```
42
+
43
+ ### YAML Configuration
44
+
45
+ Create a `config.yml` file:
46
+
47
+ ```yaml
48
+ SSH_PRIVATE_KEY: |
49
+ -----BEGIN RSA PRIVATE KEY-----
50
+ Your private key here
51
+ -----END RSA PRIVATE KEY-----
52
+ SSH_HOST: your-server.com
53
+ SSH_PORT: 22
54
+ SSH_USER: username
55
+ SSH_PASSWORD: password
56
+ SSH_PUBLISH_DIRECTORY: /var/www/html
57
+ ```
58
+
59
+ ### Options
60
+
61
+ #### publishToSsh Parameters
62
+
63
+ - `needCompressionDirectoryPath`: Path to the directory to compress
64
+ - `projectName`: Name of your project
65
+ - `isPassword`: Use password authentication (`true`) or private key (`false`)
66
+
67
+ #### yamlMethod Parameters
68
+
69
+ - `yamlPath`: Path to the YAML configuration file
70
+
71
+ #### optionsMethod Parameters
72
+
73
+ - `host`: SSH server host
74
+ - `port`: SSH port (default: 22)
75
+ - `username`: SSH username
76
+ - `password`: SSH password (for password authentication)
77
+ - `privateKey`: SSH private key (for key authentication)
78
+ - `method`: Authentication method (`"password"` or `"privateKey"`)
79
+ - `sshPublishDirectory`: Target directory on the server
80
+
81
+ ## Requirements
82
+
83
+ - Node.js >= 18.0.0
84
+ - SSH access to your server
85
+ - Appropriate permissions on the target directory
86
+
87
+ ## License
88
+
89
+ MIT
90
+
91
+ ## Author
92
+
93
+ ITCODE 2021
94
+
95
+ ## Support
96
+
97
+ For issues and questions, please visit the [GitHub repository](https://github.com/your-username/fast-web-deployment).