npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nextjs-hostinger-deploy

v1.0.1

Published

CLI tool for Next.js static export and FTP deployment to Hostinger shared hosting

Readme

nextjs-hostinger-deploy

npm version

A CLI tool to export a Next.js project to static files and deploy them to Hostinger shared hosting via FTP.

Short command: Use nhd instead of nextjs-hostinger-deploy (e.g., npx nhd init).

Installation

npm install -g nextjs-hostinger-deploy

Or for local development:

git clone <this-repo>
cd nextjs-hostinger-deploy
npm install
npm run build
npm link

Usage

Prerequisites

  • Your Next.js project must be configured for static export (using pages router).
  • Run npm run build in your Next.js project before exporting.
  • Obtain FTP credentials from your Hostinger control panel (see below).

Getting FTP Credentials from Hostinger

  1. Log in to your Hostinger account at hostinger.com.
  2. Go to your Hosting dashboard.
  3. Select your hosting plan/domain.
  4. In the control panel, navigate to Files > FTP Accounts.
  5. If no FTP account exists:
    • Click Create FTP Account.
    • Enter a username (e.g., your domain name or a custom one).
    • Set a password (or use the generated one).
    • Set the directory to /public_html (or your desired root).
    • Click Create.
  6. Copy the following details:
    • FTP Host: Usually ftp.yourdomain.com (shown in the FTP Accounts list).
    • FTP Username: The username you created (e.g., [email protected]).
    • FTP Password: The password you set.
  7. Use these in your .env.local file or GitHub Secrets as FTP_HOST, FTP_USER, FTP_PASS.

Commands

Initialize Project for Deployment

nextjs-hostinger-deploy init
# or
nhd init

This command:

  • Configures next.config.js for static export if not already set.
  • Creates .env.example with FTP credential placeholders.
  • Generates .github/workflows/deploy.yml for automated deployment on push to master.

After running init, follow the on-screen instructions to set up credentials and GitHub Secrets.

Export Next.js to static files

nextjs-hostinger-deploy export
# or
nhd export

This runs npx next export in the current directory.

Deploy to Hostinger via FTP

nextjs-hostinger-deploy deploy -h <ftp-host> -u <username> -p <password> [-d <local-dir>] [-r <remote-dir>]
# or
nhd deploy -h <ftp-host> -u <username> -p <password> [-d <local-dir>] [-r <remote-dir>]
  • -h, --host: FTP server host (e.g., ftp.yourdomain.com)
  • -u, --user: FTP username
  • -p, --password: FTP password
  • -d, --dir: Local directory to upload (default: 'out')
  • -r, --remote: Remote directory on server (default: '/public_html')

Full export and deploy

nextjs-hostinger-deploy full -h <ftp-host> -u <username> -p <password> [-d <local-dir>] [-r <remote-dir>]
# or
nhd full -h <ftp-host> -u <username> -p <password> [-d <local-dir>] [-r <remote-dir>]

Combines export and deploy in one command.

Configuration

For security, consider using environment variables or a config file for FTP credentials instead of command-line arguments.

Development

npm run dev  # Run with ts-node
npm run build  # Compile to JavaScript
npm start  # Run compiled version

Publishing to npm

To make this package available on npm for others to install:

Testing Locally First

Before publishing, test the package locally to ensure it works:

  1. In this project directory, link it globally:
    npm link
  2. Create a test Next.js project in another directory:
    npx create-next-app test-project
    cd test-project
  3. Link the local package:
    npm link nextjs-hostinger-deploy
  4. Test the commands:
    nhd init
    nhd export  # After building: npm run build
  5. If issues, fix and rebuild (npm run build), then unlink and relink.

Publishing to npm

  1. Ensure you have an npm account: Sign up at npmjs.com if you don't have one.
  2. Log in to npm via CLI:
    npm login
  3. Update package.json if needed:
    • Ensure name is unique (checked: nextjs-hostinger-deploy is available).
    • Set version to a new version (e.g., increment from current, like 1.0.1).
    • Add a repository field: "repository": "https://github.com/yourusername/nextjs-hostinger-deploy"
  4. Build the project:
    npm run build
  5. Test publish (dry run):
    npm publish --dry-run
    • This simulates publishing without actually uploading.
  6. Publish for real:
    npm publish
    • For a beta release: npm version prerelease (e.g., 1.0.1-beta.0), then npm publish --tag beta.
    • Users can install beta with npm install nextjs-hostinger-deploy@beta.

After publishing, users can install with npm install -g nextjs-hostinger-deploy or npm install --save-dev nextjs-hostinger-deploy.