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

srvs

v0.5.3

Published

Zero dependency dev server

Downloads

7

Readme

srvs serves modern webapps for dev, with none of the fat

Build Status codecov npm

srvs is a zero dependency dev server with support for static content in addition to JavaScript modules hosted from local files and unpkg.com.

Installation

Global

npm i -g srvs

Then you may run with:

srvs

npx

No install required, just run:

npx srvs

(npx comes with npm 5.2+ and higher.)

Local

Install with npm / Yarn:

npm i -D srvs

Then add srvs to the scripts in your package.json:

"scripts": {
  "start": "srvs"
}

Now you may run with:

npm start

Usage

Command Line

Here are the available command line arguments:

| Argument | Usage | Default | | ---------- | ------------------------------------------------------------------------------- | ------- | | port | The port on which the dev server will listen. | 8080 | | docRoot | The relative path from which static assets such as index.html will be served. | public | | scriptRoot | The relative path from which local JavaScript modules will be served. | src |

Each argument is passed in the form --argument=value. Here is an example using all available arguments:

npx srvs --port=3000 --docRoot=static --scriptRoot=js

API

srvs offers a programmatic way to integrate running with existing JavaScript code.

You may bring in the srvs API function using import if you have support for ES6 syntax:

import srvs from "srvs";

srvs(options).then(config => {
  // dev server is now open for business
});

Or using require:

const srvs = require("srvs");

srvs(options).then(config => {
  // dev server is now open for business
});

The options object has the same properties and values as the arguments supported by the command line version. The config parameter provided to the resolved Promise has the same properties as options.

Notes

  • This is only for use as a development tool, please do not use in production.
  • The docRoot and scriptRoot options will fall back to the current directory if they don't exist.
  • If you intend to use dynamic import (as the examples/hot project does) to hot reload changed modules, be aware this is not supported by some browsers.
  • The BROWSER environment variable can be used to control which application to open your page in, or set to none to disable browser opening entirely. This feature is inspired by the popular create-react-app.

License

srvs is MIT licensed. See LICENSE.