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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nginx-backup

v1.0.1

Published

The `Nginx Proxy Manager Backup` package provides an easy way to backup and restore configurations from Nginx Proxy Manager. It offers both programmatic access via a TypeScript API and a command-line interface (CLI) for ease of use.

Downloads

7

Readme

Nginx Proxy Manager Backup

The Nginx Proxy Manager Backup package provides an easy way to backup and restore configurations from Nginx Proxy Manager. It offers both programmatic access via a TypeScript API and a command-line interface (CLI) for ease of use.

Table of Contents

Installation

To use the Nginx Proxy Manager Backup package, you need to install it from npm:

npm install nginx-backup

Usage

Programmatic Use

To use the package in your TypeScript project, follow these steps:

  1. Import and Set Up:

    import { NginxManager } from 'nginx-backup';
    import { Backups } from 'nginx-backup';
    
    const manager = new NginxManager('https://your-nginx-url', {
      username: 'your-username',
      password: 'your-password',
    });
  2. Login:

    Ensure you log in to obtain an authentication token:

    await manager.api.login();
  3. Create a Backup:

    await Backups.createBackup(manager, './backup-directory');
  4. Restore a Backup:

    await Backups.restoreBackup(manager, './backup-directory/backup.json');

CLI Usage

To use the package via CLI, follow these steps:

  1. Install Globally:

    After publishing, install the package globally:

    npm install -g nginx-backup
  2. Create a Backup:

    To create a backup, run:

    nginx-backup create --url <NPM_URL> --username <USERNAME> --password <PASSWORD> --output-dir <OUTPUT_DIR>

    Replace <NPM_URL>, <USERNAME>, <PASSWORD>, and <OUTPUT_DIR> with your Nginx Proxy Manager URL, credentials, and desired backup directory.

  3. Restore a Backup:

    To restore a backup, run:

    nginx-backup restore --url <NPM_URL> --username <USERNAME> --password <PASSWORD> --file <BACKUP_FILE>

    Replace <NPM_URL>, <USERNAME>, <PASSWORD>, and <BACKUP_FILE> with your Nginx Proxy Manager URL, credentials, and path to the backup file.

Configuration

CLI Configuration

You can configure the CLI commands with the following options:

  • --url - The URL of your Nginx Proxy Manager instance.
  • --username - Your Nginx Proxy Manager username.
  • --password - Your Nginx Proxy Manager password.
  • --output-dir - Directory where the backup will be saved (for backup creation).
  • --file - Path to the backup file to restore (for restore).

Programmatic Configuration

Configure the NginxManager with your instance URL and credentials:

const manager = new NginxManager('https://your-nginx-url', {
  username: 'your-username',
  password: 'your-password',
});

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.