
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
brick-router
Advanced tools
Static asset server that can write to files.
$ npm install brick-router
const brick = require('brick-router')
const fs = require('fs')
const router = brick()
router.on('/index.html', cb => {
const rs = fs.createReadStream('index.html')
cb(null, rs)
})
// use as router
router.match('/index.html', (err, res) => {
if (err) throw err
res.pipe(process.stdout)
})
// write to file
router.build(__dirname + '/my-dirname')
In development an application usually goes through 3 stages:
When switching stages it's common to throw out your build process, and start
from scratch. brick-router
allows you to keep the same build process by
serving files both in-memory (for experimentation and servers) and being able
to write to the filesystem (for static pages).
Create a new router.
Register a new path in the router. The callback either accepts data or a ReadableStream.
Match a path on the router, pass in an optional callback to the router which can later be called.
Execute all routes and write the output to a directory tree so it can be served statically. Calls an optional callback on completion.
FAQs
Modular router for serving static assets
We found that brick-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.