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

s1

v0.2.2

Published

Static server for SPA development

Downloads

15

Readme

s1 – Static server for SPA development

The light and simple node-way static server with mod_rewrite. Best suitable for single-page apps development but can be used to host anything static.

Please, avoid using it in production.

Using

Install via npm (preferred globally).

npm -g install s1

Go to your project's public assets directory and run s1 executable.

cd app/public && s1

Now open localhost:8080 and enjoy your work.

CLI options

$ s1 --help
Usage: s1 [options]

Options:
  -h, --host, --ip      Host or IP to bind                  [default: "0.0.0.0"]
  -p, --port            Port                                     [default: 8080]
  -d, --dir, --root     Root directory                           [default: "./"]
  -i, --index           Index file                       [default: "index.html"]
  -c, --config, --conf  Config module                      [default: "./config"]
  --help                Show help                                      [boolean]

Config

The config is the basic Node.js module exporting object. It is located at s1's root directory, e.g., if installed globally in OS X /usr/local/lib/node_modules/s1/config.js.

You can have as many configs as you want, store it where you want, and pass needed one to the s1 using -c or --config cli switch.

For example:

s1 --config ~/myapps/config.app1.js

Config options

All config options except rewrite could be redefined from CLI.

Name | Type | Default | Description --------|----------|--------------|------------ host | String | 0.0.0.0 | Host or interface's IP address s1 will be bound to. By default binds to ALL interfaces. port | Number | 8080 | Binding port. dir | String | ./ | Root directory from which files will be hosted. Default to current directory. index | String | index.html | Index file name. Your app's entry. rewrite | Array | base rewrite | Array with rules for mod_rewrite engine. s1 uses connect-modrewrite which rules are similiar to classic mod_rewrite in Nginx or Apache. You can use s1's options in rules using {{property}} syntax.

Contributing

The main purpose of the server is to stay tiny and easy to use in everyday development tasks. So if you got any use case you think is widely popular but poorly supported by s1 – feel free to tell me about it, or try to implement it yourself and send the PR.