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

cli-http-server

v1.3.3

Published

A local web server is a command line application for serving static web pages on a local developmeant machine. It watches for file change and refresh your page.

Downloads

11

Readme

cli-http-server

A local web server is a command line application for serving static web pages on a local developmeant machine. It watches for file change and refresh your page.

Installation

npm install cli-http-server

Usage

Install the package globally using the npm installation command

install via npm

npm i -g cli-http-server

install via yarn

yarn global add cli-http-server

Start the server by cd to you project folder and running the command serverlc on the command line window.

To Start Server

run serverlc on the cli window. Make sure you are running the command on your project directory. If your run the command on another directory other than your project directory, then you have to pass the full path to your project directory as an option us using --dir or -d cli option. Example serverlc --dir='C:/some-folder/anoter-folder/this-folder' Where this-folder should be the main folder that contains your project

When the above command is ran on the cli window, the server will start on the default port of 9696 on your development machine. You can change the port by using --port or -p cli option. e.g serverlc --port=3030

when the starts, it will serve any index.html file on the current working directory as the home page. That is localhost:port/ will default to any index.html file on your project folder. If you do not have any file named index.html or you want to use to another file, you can pass the file name to the cli option --index or -i. e.g serverlc -i=app.html. You can navigate to other pages by using the relative path to the file as the url. e.g localhost:port/about will server the about.html file the <root> directory while localhost:port/page/about will serve the about.html file in the <root>/page folder. If you want the server to serve any other file type other than .html file, then you have to include the file extention as in localhost:port/my-image.png or localhost:port/pgk.json.

cli options:

| Option | Description | | -------- | ---------- | | -v, --version | Print the app version | | -d, --dir | The full path to the directory that contains your static assets (default: C:/current/working/directory) | | -i, --index | The file name of the html file to be served as the index (or root) file - home page by the server. (default: index.html) | | -p, --port | The port on which the server serves the html file. (default: 9696) | | -o, --open | Open a browser when the server start. Default true (default: true) | | -no-o, --no-open | Do not open a browser when the server start. | | -w, --watch | watch for file change and refresh the browser after ward. (default: true) | | -no-w, --no-watch | Disable browser resresh on file change. | | -h, --help | display help for command |

License

License under the MIT