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

easy-express-server

v0.0.1

Published

Easy expressjs predefined and configurable server

Downloads

3

Readme

Easy expressjs predefined and configurable server.

###Install npm -g install easy-express-server

###Usage EES is a CLI tool for prepare and start an expressjs aplication based on a json properties file.

ees -P ./propertiesFile.json

If you don't pass -P option, EES will attepmt to use 'ees_properties.json' from the current dir.

###Properties

  • app: A single name for the app.
  • main: Main path from where all other paths will be relative to. By default, the current dir.
  • server: An object with two availables properties: http and https.
    • http: An object with a listen propertie in which you can define port,hostname and backlog that configures an http server for the expressjs app.
    • https: An object with a listen propertie such as http. Also you can define https options:
      • key: Path to the certificate key.
      • cert: Path to the certificate.
      • pfx: Path to the pfx file. If you define this file, key and cert will be ignored.
  • static: An object to configure the static service. You must define the main path for the static files. Also you can define static settings (See express documentation).
  • loaders: Array of loaders configuration. Each middleware function will be loaded by requiring all module files who match each configuration.
    • main: The main path in wich the loader searches for modules. Also, this is the "root" path for these modules.
    • method: Method name that will be used to load each middleware function. All available methods are:
    • config: All modules loaded with config method must be a function that receives the expressjs application. Use this method if you want to add specific configuration programatically.
      • locals: All modules loaded with locals method must be a json file. Each propertie of json file will be set to app.locals object.
      • express functions: All modules loaded with the following methods must export the middleware function or an array of middleware functions. If dirouting is set to false, you must allways exports an array in wich the first index should be the endpoint route. Supported functions are:
        • all
        • delete
        • engine
        • get
        • post
        • put
        • render
        • use
        • ws (If websockets are enabled)
    • filter: A regular expression used to filter each file that will be required.For more info see EML documentation.
    • depth: Number indicating how deep in the main path you want to load. For more info see EML documentation.
    • dirouting: Set to true if you want to register each endpoint relative to the main path. By default, false. Then, if you main path is "/home/dev/api": /home/dev/api/index.js -> this module will be loaded in "/" endpoint, because for the loader "/home/dev/api" is te root. /home/dev/api/login/login.js -> this module will be loaded in "/login" endpoint. /home/dev/api/content/content.js -> this module will be loaded in "/content" endpoint and so on...
  • ws: Options object passed to WebSocketServer constructor. See express-ws. The websocket instance will be stored in app.wsInstance.

See examples!!