Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
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
Once installed, you can serve static files by specifying the directory/file path:
tsx-serve ./public
--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.Serve files from the ./dist
directory on port 4000
:
tsx-serve -p 4000 ./dist
Access your files via http://localhost:4000.
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
Currently, only Linux and macOS are supported. Windows support will be added soon.
If you want to modify or contribute to this project, follow these steps:
Clone the repository:
git clone https://github.com/byomess/tsx-serve.git
Install dependencies:
npm install
Build the project:
npm run build
Link the CLI for local development:
npm link
Contributions are welcome! Feel free to open issues or submit pull requests on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for more details.
FAQs
A simple static file server CLI tool.
We found that tsx-serve demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.