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

ip-anchor

v0.0.5

Published

A tool to configure domain and IP for local development

Downloads

8

Readme

Ip-Anchor

Overview

Ip-Anchor is a Node.js tool designed for developers to easily configure their local development environment with custom domain names and IP addresses. It automates the process of setting up local domains and SSL certificates, streamlining the development workflow.

Features

  • Easy configuration of local domain names and IP addresses.
  • Automatic SSL certificate generation for secure local development.
  • Supports multiple platforms including Windows, macOS, and Linux.
  • Command-line interface for quick and straightforward setup.

Prerequisites

  • Node.js: Make sure you have Node.js installed on your machine.
  • npm: Required for installing the tool globally.

Installation

You can install Ip-Anchor globally using npm. This allows you to use it from anywhere in your terminal.

Using npm:

npm install -g ip-anchor

Usage

To configure a local domain with Ip-Anchor, simply run the following command in your terminal:

ip-anchor <IP-ADDRESS> <DOMAIN-NAME>

Example:

ip-anchor 192.168.1.100 mycustomdomain.com

This will set up the specified IP address and domain name for local development.

Configuration Options

The Ip-Anchor tool accepts the following arguments:

  • IP Address: The local IP address you want to associate with a custom domain.
  • Domain Name: The custom domain name you want to set up for local development.

Using with Vite

To use DomainConfigurator with Vite, a frontend build tool, follow these steps:

  1. Configure Domain and IP: First, use DomainConfigurator to set up your custom domain and IP address as described in the Usage section.

  2. Update Vite Config: In your project's vite.config.js file, set the server host to your custom domain:

    export default {
      server: {
        host: 'mycustomdomain.com'
      }
    }
  3. Start Vite: Run vite or npm run dev (if you've set up a script for it) to start the Vite development server. It should now be accessible at http://mycustomdomain.com (or another port if you've configured it differently).

  4. SSL Configuration: If you've set up SSL certificates with DomainConfigurator, you may also want to configure Vite to use these certificates for HTTPS. Update your vite.config.js to include the path to your key and certificate:

    import fs from 'fs';
    import path from 'path';
    
    export default {
      server: {
        host: 'mycustomdomain.com',
        https: {
          key: fs.readFileSync(path.resolve(__dirname, '.cert/key.pem')),
          cert: fs.readFileSync(path.resolve(__dirname, '.cert/cert.pem'))
        }
      }
    }
  5. Access Your Project: Open a browser and navigate to your custom domain (e.g., https://mycustomdomain.com). You should see your Vite project running.

Remember to replace 'mycustomdomain.com' with the actual domain you configured and adjust the paths to your SSL certificates if they are located elsewhere.

Troubleshooting

If you encounter any issues while using Ip-Anchor, please ensure that:

  • You have the necessary permissions to modify system files.
  • Your Node.js and npm versions are up to date.
  • You have correctly entered the IP address and domain name.

Contributing

Contributions to Ip-Anchor are welcome! If you have suggestions for improvements or encounter any issues, please feel free to open an issue or submit a pull request on our GitHub repository.