eraters / playit.gg

A JavaScript wrapper for Playit.GG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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...>

Options:
  -V, --version                  output the version number
  -t, --tunnels <Port:Proto...>  tunnels to create with the specified port and prototype
  -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 Methods 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!

About

A JavaScript wrapper for Playit.GG

License:MIT License


Languages

Language:TypeScript 77.9%Language:JavaScript 22.1%