# localhost-run

> Node client for localhost.run

Latest version **1.4.0** (published 2025-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install localhost-run
pnpm add localhost-run
yarn add localhost-run
bun add localhost-run
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2025-11-03 |
| First published | 2022-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Fabrizio Ruggeri |
| Maintainers | ramiel |

## Links

- npm: https://www.npmjs.com/package/localhost-run
- Repository: https://github.com/ramiel/localhost-run-node
- Homepage: https://github.com/ramiel/localhost-run-node#readme
- Issues: https://github.com/ramiel/localhost-run-node/issues
- npm.io page: https://npm.io/package/localhost-run

## Recent versions

- 1.4.0 (latest) — 2025-11-03
- 1.3.0 — 2023-02-15
- 1.2.2 — 2022-08-18
- 1.2.1 — 2022-08-18
- 1.2.0 — 2022-08-18
- 1.1.1 — 2022-08-18
- 1.1.0 — 2022-08-18
- 1.0.1 — 2022-06-06
- 1.0.0 — 2022-06-06

## README

# Localhost.run

Open a tunnel with localhost.run and expose the url

```ts
import { createExternalUrl } from "localhost-run";

const result = await createExternalUrl({ port: 3000 });

console.log(result);

// Prints
// {
//   domain: '1234.lhrtunnel.link',
//   secure: 'https://1234.lhrtunnel.link',
//   insecure: 'http://1234.lhrtunnel.link',
// }
```

## Using custom domains

You can use custom domain as well, if you have an active [subscription]()

```ts
import { createExternalUrl } from "localhost-run";

const result = await createExternalUrl({
  port: 3000,
  domain: tunnel.example.com,
});

console.log(result);

// Prints
// {
//   domain: 'tunnel.example.com',
//   secure: 'https://tunnel.example.com',
//   insecure: 'http://tunnel.example.com',
// }
```

## Closing the tunnel

```ts
import { createExternalUrl } from "localhost-run";

const tunnel = await createExternalUrl({
  port: 3000,
});

tunnel.close(); // returns true when succeded
```

## Notes

This is a little personal project, it's not affiliated with localhost.run.  
This software currently rely on the presenc of `ssh` binary in your environment

---
_Source: https://npm.io/package/localhost-run · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
