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

@vivaxy/here

v3.5.0

Published

local static server

Downloads

17

Readme

here

here

Build Status NPM Version NPM Downloads MIT License

Local static server

Everything start from here.

Node.js >= 8.0

Feature

  • Look up available port automatically, which means multiple instances without specifying port.

  • Custom routes by scripting here.js.

  • Live reload.

  • Support https.

  • Add ip address to your server, which makes your server available to other devices.

  • Resolve get, post... every method into local files, for ajax.

  • Respond files without extension as application/json for ajax.

  • Open default browser after server launched.

  • When the server is on, press enter will open the browser.

Installation

[sudo] npm install -g @vivaxy/here

Usage

In your local folder, type here and it goes!

Advanced Usage

Specify port to 8888

here -p 8888

or

here --port 8888

Default port is 3000.

Switch protocol to https

here -S

or

here --ssl

Open Gzip

here -G

or

here --gzip

Specify server root directory

here -d test

or

here --directory test

Default directory is ./.

Watch file changes, once files changed, reload pages

here -w 3

or

here --watch

Default interval is 0 second.

Recommend to set reload interval to page reload time.

Do not open the browser

here -s

or

here --silent

Specify open browser IP

here --ip localhost

or

here --ip private

or

here --ip public

Default IP is public.

Output log

here -l

or

here --log 0

Middleware support

Write here.js in server base directory.

let db = {
  tobi: {
    name: 'tobi',
    age: 21
  },
  loki: {
    name: 'loki',
    age: 26
  },
  jane: {
    name: 'jane',
    age: 18
  }
};

module.exports = [
  {
    method: 'get',
    path: '/pets',
    data () {
      let names = Object.keys(db);
      return names.map((name) => {
        return db[name];
      });
    }
  },
  {
    method: 'get',
    path: '/pets/:name',
    data () {
      let name = this.params.name;
      let pet = db[name];
      if (!pet) {
        return {
          error: `cannot find pet ${name}`
        };
      } else {
        return pet;
      }
    }
  }
];

See koa-router document for more detail.

Prior Art

  • puer not support post, respond files without extension as application/octet-stream
  • anywhere not support post, and not support reload
  • browsersync not support post, respond files without extension as application/octet-stream
  • serve

Change Log

Change Log

Contributing

Contributing