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

servino

v2.0.9

Published

Zero-configuration http server with hot reload

Downloads

156

Readme

⚡️ Servino

Servino is zero-configuration http server with hot reload.

Install

$ npm i -g servino
# or
$ npm i servino --save-dev

CLI

# Getting start
sv -r src -p 3000

# long command
sv --port 8125 --delay 500 --inject --wdir tests,public --ignore node_modules,.git

# short
sv -p 8125 -d 500 -w tests,public -i node_modules,.git -s tests/cert.pem,tests/key.pem

API

const Servino = require('Servino')

const servino = Servino(options?: object) : void

servino.start() // start server
servino.stop() // stop server

Available Options

| options/Command | Example | Description | |----------|---------------------------------|-------------------------------| |--config or -c | null | specify where config json file is located (directory) | |--host or -H | '127.0.0.1' | Set the server address | |--port or -p | 8125 | Set the server port. | |--root or -r | 'public' | Set root directory that's being served. Default: current working directory | |--ignore or -i | node_modules,.git | which's files or folders should be ignored (Watch ignore) | |--wdir or -w | tests,public | Paths to watch for changes. Default: watch everything under root directory | |--delay or -d | 200 | Realod time between changes (ms). | |--inject or -I | true | Inject Css and Javascript files without refresh the browser | |--open or -o | true | Open url on the browser | |--verbose or -V | true | Show logs | |--ssl or -s | tests/cert.pem,tests/key.pem | ssl certifications |

Config file: servino.json

/*
  command: sv -c tests
  A config file can take any of the command line arguments as JSON key values, for example:
*/
{
  "host": "0.0.0.0",
  "port": 8125,
  "root": ".",
  "wdir": [
    "app",
    "src"
  ],
  "delay": 100,
  "ignore":[
    "node_modules",
    "dist",
    ".git"
  ],
  "inject": true,
  "open": true,
  "verbose": true,
  "ssl": [
    "tests/cert.pem",
    "tests/key.pem"
  ]
}

TLS/SSL

First, you need to make sure that openssl is installed correctly, and you have key.pem and cert.pem files. You can generate them using this command:

openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem

Then you need to run the server with -s for your certificate files.

# Note: order important
servino -s tests/cert.pem,tests/key.pem

Notes

  • All pull requests are welcome, feel free.

Author

License

MIT