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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@apnet_vector/flare

v1.5.1

Published

Lightweight wrapper over express, allowing to create applications comfortably

Downloads

15

Readme

APNET Flare 1.5.1 - Middlewares and types

Lightweight wrapper over express, allowing to create application comfortably

Features

  • Quick creation of an application with basic features
  • BodyParser out of the box
  • CookieParser out of the box
  • Handy log system
  • Easy creation of large APIs
  • TypeScript support

Guide to creating an app

Create app

const { FlareApp } = require("@apnet_vector/flare");

// You can specify the name of the application
const app = new FlareApp('Test App');

Result:

APNET Flare <version>

[Flare] Creating Application...
[Flare] Test App successfully created

Run app on port

// the application will run on port 3000
app.run(3000, () => {
    // you can bind the custom action on successful application startup
    console.log('custom action');
})

Result:

APNET Flare <version>

[Flare] Creating Application...
[Flare] Test App successfully created
[Flare] Application successfully started on 3000
custom action //custom action is started

If you go to localhost:3000 you will see the following message:

Cannot GET /

Create API

First, let's understand the API components in Flare

Endpoints

Endpoints allow you to process requests

const homeEndpoint = endpoint({
    //path to the endpoint
    path: 'home',
    //type of HTTP request
    requestType: 'get',

    middlewares: [
        //your middlewares
    ],

    //Handler function, as in Express
    handler: ({ 
        //Req, res, next - provided by express
        req,
        res,
        next,
        
        //Cookies from request (cookie-parser)
        cookies,
        //Request body (body-parser)
        body,
        
        //Log function from Flare
        log,
     }) => {
        
        //Flare will display from which endpoint the message was sent
        log('message');
        
        //Send a response to the user
        res.json('hello world!')
    }
});

Controllers

Controllers - folders for endpoints, they allow to create convenient and beautifully structured APIs

const rootController = controller(
    //path of controller
    '/city',
    //child endpoints or controllers
    [
        //Connect our endpoint from the previous example
        homeEndpoint,
        
        //Let's create another endpoint as an example
        endpoint({
            path: 'shop',
            requestType: 'get',
            handler: ({
                res
            }) => {
                res.json('hello world from shop!')
            }
        }),
    ]
)

Setup API to the application

app.setupAPI(rootController)

Now let's check the result

On startup, we see the following messages:

[get] [/city/home] successfully added!
[get] [/city/shop] successfully added!

In browser:

http://localhost:3000/city/home:
"hello world!"
http://localhost:3000/city/shop:
"hello world from shop!"

Advanced

To add additional functionality to Express, you will need to access an instance of the Express application (e.g. use HandleBars Engine or express static)

app.getInstance().use(...something...)