Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Finally.js is a Node.js tool for seamlessly deploying website files to an FTP server. It automates the process of collecting files from a specified directory and ensures secure authentication through environment variables. Ideal for developers looking to
Finally.js is a Node.js tool for seamlessly deploying website files to an FTP server. It automates the process of collecting files from a specified directory and ensures secure authentication through environment variables. Ideal for developers looking to streamline their deployment process, Finally.js can be effortlessly integrated with GitHub Actions for automated deployments.
Every star on this repository is a sign of encouragement, a vote of confidence, and a reminder that our work is making a difference. If this project has brought value to you, even in the smallest way, please consider showing your support by giving it a star. ⭐
"Star" button located at the top-right of the page, near the repository name.
Your star isn’t just a digital icon—it’s a beacon that tells us we're on the right path, that our efforts are appreciated, and that this work matters. It fuels our passion and drives us to keep improving, building, and sharing.
If you believe in what we’re doing, please share this project with others who might find it helpful. Together, we can create something truly meaningful.
Thank you for being part of this journey. Your support means the world to us. 🌍💖
Step 2: Add Finally.js to your project:
npm install finally.js
Step 3: Create a finally.c.json
file in the root of your project.
Step 4: Add the following content to the finally.c.json
file:
{
"host": "FTPSERV_ENV_VAR",
"port": 21,
"user": "FTPUSER_ENV_VAR",
"password": "FTPPASS_ENV_VAR",
"secure": false
}
Step 5: Replace FTPSERV_ENV_VAR
, FTPUSER_ENV_VAR
, and FTPPASS_ENV_VAR
with the respective environment variables for your FTP server.
Step 1: Run the deployment script to upload your files:
finally -b dist -r /public_html
Step 2: The script will connect to the FTP server and upload all files from the specified local directory (dist
) to the target directory (/public_html
) on the server.
Finally.js provides a variety of CLI options to customize your deployment process:
-b, --basePath <path>
: Specifies the local base path of the files to upload. This option is required.-r, --remoteBasePath <path>
: Specifies the remote base path on the FTP server. This option is required.-i, --ignorePattern <patterns...>
: Defines patterns to ignore during the upload. The default is ["./node_modules/**", ".git/**"]
.-n, --ftpVerbose
: Enables verbose mode for FTP, which provides detailed logs during the upload process.-h, --host <host>
: Sets the FTP server host. By default, it is fetched from the configured environment variable.-p, --port <port>
: Sets the FTP server port. By default, it is fetched from the configuration.-u, --user <user>
: Sets the FTP server username. By default, it is fetched from the configured environment variable.-a, --password <password>
: Sets the FTP server password. By default, it is fetched from the configured environment variable.--secure
: Enables a secure FTP connection (FTPS). By default, it is determined by the configuration.You can pass additional options to Finally.js for more advanced deployments:
npx finally -b dist -r /public_html -i test/** devfiles/** --ftpVerbose -h ftp.example.com -p 21 -u exampleuser --password examplepass --secure
In this example:
dist
folder will be uploaded to the /public_html
directory on the FTP server.test
and devfiles
will be ignored during the upload.host
, user
, password
) are provided directly through the CLI.Here's a step-by-step example of how to deploy files using Finally.js:
Step 1: Setup a Sample Project: Create a sample project directory and add some files to a dist
folder:
mkdir sample-project
cd sample-project
mkdir dist
echo "Hello World" > dist/index.html
Step 2: Create Configuration File (optional⚠️): In the sample-project
directory, create a finally.c.json
file with your FTP server details:
{
"host": "FTPSERV_ENV_VAR",
"port": 21,
"user": "FTPUSER_ENV_VAR",
"password": "FTPPASS_ENV_VAR",
"secure": false
}
Step 3: Deploy Files: Run the deployment command to upload your files to the FTP server:
npx finally -b dist -r /public_html
To automate deployments with Finally.js using GitHub Actions, add the following workflow file (.github/workflows/deploy.yml
) to your repository:
name: FTP Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.3
with:
node-version: "20"
- name: Install Finally.js
run: npm install finally.js
- name: Deploy to FTP
env:
FTP_SERVER: ${{ secrets.FTP_SERVER }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
run: finally -b dist -r /public_html -h ${{ secrets.FTP_SERVER }} -u ${{ secrets.FTP_USERNAME }} --password ${{ secrets.FTP_PASSWORD }} --port 21 --secure
Key Points:
main
branch.By following these steps, you can set up automated deployments directly from your GitHub repository to your FTP server.
This project is licensed under the MIT.
We’re always open to contributions and fixing issues—your help makes this project better for everyone.
If you encounter any errors or issues, please don’t hesitate to raise an issue. This ensures we can address problems quickly and improve the project.
For those who want to contribute, we kindly ask you to review our Contribution Guidelines before getting started. This helps ensure that all contributions align with the project's direction and comply with our existing license.
We deeply appreciate everyone who contributes or raises issues—your efforts are crucial to building a stronger community. Together, we can create something truly impactful.
Thank you for being part of this journey!
For any questions, please reach out via hello@darsan.in or LinkedIn.
Credit to patrickjuchli for the basic-ftp npm package.
FAQs
Finally.js is a Node.js tool for seamlessly deploying website files to an FTP server. It automates the process of collecting files from a specified directory and ensures secure authentication through environment variables. Ideal for developers looking to
We found that finally.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.