codespaces
v0.1.3
Published
Utility functions for use within, or for adding better project support for GitHub Codespaces
Downloads
7
Readme
Installation
npm install codespaces
Usage
import { getCodespacesTunnelUrl } from "codespaces";
// Get the current GitHub Codespaces tunnel URL at a specific port.
const url = getCodespacesTunnelUrl({ port: 2000 });
console.log(url); // https://ridafkih-code...-2000.githubpreview.dev
import { getCodespacesEnvironment } from "codespaces";
// Get general JSON information about the current GitHub Codespaces
const environment = getCodespacesEnvironment();
console.log(environment); // { isCodespaces: true, ...