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

tsx-serve

v1.1.19

Published

A simple static file server CLI tool.

Downloads

44

Readme

tsx-serve

tsx-serve is a lightweight, TypeScript-based static file server CLI built on top of Express.js. It allows you to quickly serve static files from any directory with customizable options, making it perfect for local development, file sharing, or simple hosting solutions.

Has built-in tunneling support with custom sub-domains for easy sharing of your local server through the internet by simply using command arguments.

Features

  • 📦 Simple CLI to serve static files.
  • 🌍 Tunneling support for sharing your local server through the internet, allowing custom sub-domains.
  • 🌐 Express.js under the hood, offering robust and scalable serving.
  • 🚀 Lightweight and easy to use for quick development setups or file sharing.

Installation

To use tsx-serve, first install it globally using npm:

npm i -g tsx-serve

Or with yarn:

yarn global add tsx-serve

Without installing globally, you can also use npx to run the CLI:

npx tsx-serve ./public

Or with yarn:

yarn tsx-serve ./public

Usage

Once installed, you can serve static files by specifying the directory/file path:

tsx-serve ./public

Available CLI Options

  • --port or -p: Specify the port number (default: 3000).
  • --tunnel or -t: Enable tunneling support for sharing your local server through the internet.
  • --subdomain or -s: Specify a custom sub-domain for the tunnel URL.
  • --help or -h: Show the usage guide.

Example

Serve files from the ./dist directory on port 4000:

tsx-serve -p 4000 ./dist

Access your files via http://localhost:4000.

More Examples

  • Serve files from the current directory on port 8080 using Pinggy as tunneler:

    tsx-serve -p 8080 -t pg .
  • Serve files from the ./public directory with a custom sub-domain using Localtunnel as tunneler:

     tsx-serve -t lt -s my-server ./public

Supported OSes

Currently, only Linux and macOS are supported. Windows support will be added soon.

Development

If you want to modify or contribute to this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/byomess/tsx-serve.git
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build
  4. Link the CLI for local development:

    npm link

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests on the GitHub repository.

License

This project is licensed under the MIT License. See the LICENSE file for more details.