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

fluid-express

v1.0.21

Published

Fluid components to model an express server and associated router modules.

Downloads

115

Readme

fluid-express

What is this?

This package provides a series of Fluid components that encapsulate the main features of Express. Express is a node-based server framework written in Javascript.

In addition to Express itself, this package provides:

  1. Wrappers for common routers and middleware provided with Express.
  2. Base grades that can be used in writing your own routers and middleware.

Why would I need it?

This module allows you to wire together fluid components to serve up APIs and static content. Simple server-side use cases can be implemented purely by configuring the components provided here.

How is this different from Kettle?

In the long term, the two modules will likely evolve closer to each other, but in the short term, there are few key differences.

Kettle is a server side framework written entirely as a series of Fluid components, and used extensively within the Fluid Community. Kettle better serves use cases that don't involve a markup-based UI, and provides deeper options for replacing the internals of the server. It also provides support for WebSockets.

The fluid.express module is a wrapper for Express, and only for Express. It does not do anything that Express cannot, such as communicating using WebSockets. However, as it is based on the idiom of a newer version of express, it provides the router concept introduced in Express 4.x, which Kettle does not have. It is better suited for use cases where support for complex routing and rendering of complex markup-based interfaces (as provided via fluid-handlebars) is required.

How do I use it?

To use this module, you will need to instantiate an instance of fluid.express itself (or something that extends it), and wire in at least one fluid.express.middleware module. The most basic example (serving static content) should look something like:

fluid.defaults("my.namespaced.grade", {
    gradeNames: ["fluid.express"],
    port:    8080,
    components: {
        staticRouter: {
            type: "fluid.express.router.static",
            options: {
                path:    "/",
                content: "%fluid-express/tests/html"
            }
        }
    }
});

See the documentation for the fluid.express grade for a full list of configuration options. This example configures a "static" router that is designed to serve up filesystem content (see the middleware documentation for more details).

For more information about the grades included in this package and how to use them together, take a look at the documentation in this package.