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

nx-ngrok

v1.2.1

Published

Ngrok support for Nx

Downloads

329

Readme

nx–ngrok — Secure tunnels for your targets.

Contents

Features

  • Use Ngrok to create a secure tunnel to your applications.
  • Manually define the tunnel settings.
  • Alternatively, let Ngrok wrap your existing targets to automatically read the server URL.
  • Generate a new Ngrok tunnel target for your existing apps.

Installing

Using pnpm:

pnpm add -D nx-ngrok
npm install -D nx-ngrok
yarn add -D nx-ngrok

Getting Started

Before you can serve HTML content, Ngrok requires you to sign up for a free ngrok account to get an authtoken.

It is recommended to follow Ngrok's documentation and install your authtoken.

Alternatively, you can set the authtoken via an Environment Variable or as an option in each executor.

Warning

Keep your authtoken private and safe. Do not commit it to git!

Supported Environment Variables

  • NGROK_AUTHTOKEN - Specifies the authentication token (authtoken) used to connect to the ngrok service.

Executors

tunnel

Start a new Ngrok tunnel.

"targets": {
  "dev": {
    "executor": "nx-ngrok:tunnel",
    "options": {
      "target": "examples-nextjs:serve",
    },
  },
}

| Name | Type | Required | Default | Description | | ------------- | ---------------------------------------- | :------: | --------------- | -------------------------------------------------------------------------------------------------------- | | target | string | - | - | Server target to run tunnel for. | | protocol | http, tcp, tls | - | http | The tunnel protocol name. This defines the type of tunnel you would like to start. | | address | string, number | - | - | Forward traffic to this local port number or network address. | | auth | string | - | - | HTTP Basic authentication for tunnel. | | port | targetDefault, auto, number | - | targetDefault | Override the target's port number — only supported if the target accepts a port setting. | | subdomain | string | - | - | Subdomain name to request. If unspecified, ngrok provides a unique subdomain based on your account type. | | authToken | string | - | - | Specifies the authentication token (authtoken) used to connect to the ngrok service. | | region | us, eu, au, ap, sa, jp, in | - | us | Choose the region where the ngrok agent will connect to host its tunnels. | | ngrokConfig | string | - | - | Custom path for ngrok config file. |

Generators

tunnel

Generate a target to run a Ngrok tunnel for a local server.

nx generate nx-grok:tunnel dev --project=my-app --target=serve
>  NX  Generating nx-ngrok:tunnel

UPDATE apps/my-app/project.json

| Name | Alias | Type | Required | Default | Description | | ----------- | --------------------------------- | ---------------------------------------- | :-------------: | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | name | - | string | ✅ | - | Target name. | | project | - | string | ✅ | - | What project does the target belong to? | | target | - | string | - | - | Server target to run tunnel for. | | port | targetDefault, auto, number | - | targetDefault | Override the target's port number — only supported if the target accepts a port setting. | | protocol | - | http, tcp, tls | - | http | The tunnel protocol name. This defines the type of tunnel you would like to start. | | address | - | string, number | - | - | Forward traffic to this local port number or network address. | | auth | - | string | - | - | HTTP Basic authentication for tunnel. | | subdomain | - | string | - | - | Subdomain name to request. If unspecified, ngrok provides a unique subdomain based on your account type. | | region | - | us, eu, au, ap, sa, jp, in | - | us | Choose the region where the ngrok agent will connect to host its tunnels. |

Examples

| Name | Path | | ------- | --------------------------------------------------------------------------------------------- | | nest | examples/nest | | nextjs | examples/nextjs | | nx-mesh | examples/nx-mesh-app |

Compatibility

| nx-ngrok | Nx | | ---------- | --------- | | ^1.0.0 | ^15.7.1 |

Credits

This plugin wouldn't be possible without the great teams behind these projects:

  • Ngrok - A simplified API-first ingress-as-a-service that adds connectivity, security, and observability to your apps in one line
  • Ngrok Node API - A Node wrapper for Ngrok's API.
  • Nrwl - The team behind Nx

Please show them your support! ❤️