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

@lxpt/azureflare

v0.1.10

Published

AzureFlare: The opinionated express.js web framework!

Downloads

2

Readme

AzureFlare

A highly opinionated Web Framework built on top of Express.js

Installation

Use your package manager of choice (example with pnpm)

pnpm add @lxpt/azureflare

Contributing

Just open a PR, any new features and additions are Welcome!

Usage / Examples

More extensive examples as well as the full API reference can be found at <website soon™>

Basic example using controllers

// controllers/test.ts

export class TestController extends FlareController {
	@Get('/test')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.send('Welcome to AzureFlare! Ping Pong')
	}
}

// main.ts

const flare = new FlareApp()

flare.useController(new TestController())
flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})

Middleware

Controllers with Global Middleware

// middlewares/testkey.ts

export function LogMiddlewareTest(req: FlareRequest, res: FlareResponse, next: FlareNext) {
	console.log('Global Middleware Test! x-middleware-msg:', req.get('x-middleware-msg'))

	next()
}

// controllers/test.ts

export class TestController extends FlareController {
	@Get('/test')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.send('Welcome to AzureFlare! Ping Pong')
	}
}

// main.ts

const flare = new FlareApp()

flare.useMiddleware(LogMiddlewareTest)
flare.useController(new TestController())
flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})

Controllers with Scoped middleware

// middlewares/testkey.ts

export function LogMiddlewareTest(req: FlareRequest, res: FlareResponse, next: FlareNext) {
	console.log('Controller Middleware Test! x-middleware-msg:', req.get('x-middleware-msg'))

	next()
}

// controllers/test.ts

@Middleware(LogMiddlewareTest)
export class TestController extends FlareController {
	@Get('/test')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.send('Welcome to AzureFlare! Ping Pong')
	}
}

// main.ts

const flare = new FlareApp()
flare.useController(new TestController())

flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})

Controllers with Route Scoped Middleware

// middlewares/testkey.ts

export function LogMiddlewareTest(req: FlareRequest, res: FlareResponse, next: FlareNext) {
	console.log('Route Middleware Test! x-middleware-msg:', req.get('x-middleware-msg'))

	next()
}

// controllers/test.ts

export class TestController extends FlareController {
	@Middleware(LogMiddlewareTest)
	@Get('/test')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.send('Welcome to AzureFlare! Ping Pong')
	}
}

// main.ts

const flare = new FlareApp()
flare.useController(new TestController())

flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})

Authorization

Given these two routes (one guarded, one anonymous)

// controllers/test.ts

export class TestController extends FlareController {
	@Get('/test')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.send('Welcome to AzureFlare! Ping Pong, this route is guarded!')
	}
}

// controller/fancy.ts

export class FancyController extends FlareController {
	@Anonymous()
	@Get('/fancy-test')
	public GetFancyTest(req: FlareRequest, res: FlareResponse) {
		res.send('<em>Welcome to AzureFlare, the fancy framework for express!</em>')
	}
}

Controllers with Basic Authorization

// main.ts

const flare = new FlareApp()

flare.useAuthorization(
	new FlareBasicAuthorization({
		credentials: [
			{
				username: 'someUsername',
				password: 'somePassword',
			},
		],
		realm: 'flare-realm',
		portal: true,
	})
)
flare.useControllers([new TestController(), new FancyController()])

flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})

Controllers with Secret Token Authorization

// main.ts

const flare = new FlareApp()

flare.useAuthorization(
	new FlareSecretTokenAuthorization({
		header: 'x-secret-token',
		token: 'super-secret-token',
	})
)
flare.useControllers([new TestController(), new FancyController()])

flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})

Attributable Data

Controllers with attribute data per route

// middlewares/has_banana.ts

export function HasBananaAttributeMiddleware(req: FlareRequest, res: FlareResponse, next: FlareNext) {
	const attrs = req.attributes!()
	const fruit = attrs['fruit']

	if (!fruit) {
		console.log(
			fruit === 'banana'
				? `${req.originalUrl} has a banana`
				: `There are only ${fruit} at ${req.originalUrl}`
		)
	} else {
		console.log(`There are no fruits at ${req.originalUrl}`)
	}

	next()
}

// controllers/banana.ts

export class BananaController extends FlareController {
	@Get('/banana')
	@Attribute('fruit', 'banana')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.sendStatus(200)
	}
}

// controllers/kiwi.ts

export class KiwiController extends FlareController {
	@Get('/kiwi')
	@Attribute('fruit', 'kiwi')
	public GetTest(req: FlareRequest, res: FlareResponse) {
		res.sendStatus(200)
	}
}

// main.ts

const flare = new FlareApp()

flare.useMiddleware(HasBananaAttributeMiddleware)
flare.useControllers([new BananaController(), new KiwiController()])

flare.build().listen(3000, () => {
	console.log('AzureFlare Demo is Running!')
})