New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vbarbarosh/express-helpers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vbarbarosh/express-helpers

A set of helpers for working with `express`.

  • 2.2.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
128
increased by4166.67%
Maintainers
1
Weekly downloads
 
Created
Source

A set of helpers for working with express.

Installation

npm install @vbarbarosh/express-helpers

Quick Start

cat > index.js << 'EOF'
#!/usr/bin/env node

// A basic template for node express apps

const body_parser = require('body-parser');
const cli = require('@vbarbarosh/node-helpers/src/cli');
const express = require('express');
const express_params = require('@vbarbarosh/express-helpers/src/express_params');
const express_routes = require('@vbarbarosh/express-helpers/src/express_routes');
const express_run = require('@vbarbarosh/express-helpers/src/express_run');
const path = require('path');

cli(main);

async function main()
{
    const app = express();

    app.use(express.static(path.resolve(__dirname, 'static')));
    app.use(body_parser.json());

    express_routes(app, [
        {req: 'GET /', fn: echo},
        {req: 'GET /api/v1/articles.json', fn: echo},
        {req: 'POST /api/v1/articles', fn: echo},
        {req: 'DELETE /api/v1/articles/:uid', fn: echo},
        {req: 'ALL *', fn: page404},
    ]);

    await express_run(app);
}

async function echo(req, res)
{
    res.status(200).send(express_params(req));
}

async function page404(req, res)
{
    res.status(404).send(`Page not found: ${req.path}`);
}
EOF

echo {} > package.json
npm install body-parser express @vbarbarosh/node-helpers @vbarbarosh/express-helpers
node .

FAQs

Package last updated on 20 Feb 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc