playit.gg

An Unofficial JavaScript Wrapper For https://playit.gg

Usage no npm install needed!

<script type="module">
  import playitGg from 'https://cdn.skypack.dev/playit.gg';
</script>

README

Playit.GG

An Unofficial JavaScript Wrapper For PlayIt.GG

Installation

To Install, Run:

npm i --save playit.gg

Basic Usage

const PlayIt = require('playit.gg');

(async () => {
  // Start PlayIt
  const playit = await PlayIt();

  // Create A PlayIt Tunnel
  const tunnel = await playit.createTunnel(); // Default Is TCP On Port 80

  console.log(`http://${tunnel.url}`); // Print the tunnel url
})();

CLI

To Install The CLI, Run:

npm install -g playit.gg

Or Download From The Releases

Options

Usage: PlayIt --tunnels <Port:Proto:?IP...>

Options:
  -V, --version                      output the version number
  -t, --tunnels <Port:Proto:?IP...>  Tunnels To Create With The Specified Port, Prototype And IP. The IP Is Optional
  -e, --envs <Name:Value...>         Environment Options For PlayIt
  -h, --help                         display help for command

API

Most Items In This Module Are Asynchronous

Exports

The Default Export

Type Async Returns Description
Function Yes PlayIt The Started PlayIt Class

Example:

const PlayIt = require('playit.gg');

(async () => {
  const playit = await PlayIt(); // Start PlayIt
})();

PlayIt

PlayIt Will Not Work Unless You Run The .start Method

Type Async Returns Description
Class No PlayIt The Unstarted PlayIt Class

Example:

const { PlayIt } = require('playit.gg');

let playit = new PlayIt();

(async () => {
  // Do whatever you want before starting PlayIt
  // The reason you might want to do this is to use some variables PlayIt provides before starting it
  // As it takes a few seconds to start
  playit = await playit.start(); // Start PlayIt
})();

Methods

TODO

Contribution

PRs Are Welcome!