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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@skypager/helpers-server

v1.4.0

Published

skypager server helper

Downloads

99

Readme

Skypager Server Helper

The Skypager Server Helper is used to provide a standard interface on top of any node.js server that you can think of.

By default, we provide an express based server, with optional:

  • CORS support
  • history fallback support
  • static file serving

This helper is automatically loaded by the Skypager Node Runtime

Helper Interface

A Server Helper module is any module which exports one of our functions or properties

  • cors export true, or a function which returns true, if you want to enable cors support. export an object or a function which returns an object to provide options to the cors module.
  • history export true, or a function which returns true, if you want to enable history api fallback to an index.html file
  • serveStatic export true, or a function which returns true, if you want to enable static file serving from the project's build folder.
  • appWillMount export a synchronous function, this function will be passed an instance of app which is usually your express server. Do whatever you want in this function, such as define routes on app
  • appDidMount export an asynchronous function, this function will be called right before the server starts. use this function to add additional routes, or do any sort of logic that relies on some asynchronous data
  • serverWillStart export an asynchronous function, this function will be called after the appDidMount hook. Use this function to prepare any external services your server might need to connect to when handling requests
  • serverDidFail export a function which will be called when the server fails to start
  • displayBanner export a function which will be used when the server stars to display console output
  • endpoints export an array or a function which returns an array of endpoint module ids to use. endpoint modules can be registered with the runtime.endpoints registry

Registries

With the server helper, you'll have a couple of module registries on your runtime

Endpoints Registry

runtime.endpoints
// register one at a time
runtime.endpoints.register('my-endpoint', () => require('./my-endpoint'))
// add a webpack require.context
runtime.endpoints.add(require.context('./src/endpoints', true, /\.js$/))
// or use the node runtime's requireContext to create a similar require context object 
runtime.endpoints.add(runtime.requireContext('src/endpoints'))
// see available endpoints
runtime.endpoints.available

Servers Registry

runtime.servers
// register a server module
runtime.servers.register('app', () => require('./server/app.js'))
// retrieve a server module
runtime.servers.lookup('app')
// see all available servers
runtime.servers.available