Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@buzuli/app

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buzuli/app

App scaffold for Node.js

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
496
decreased by-28.01%
Maintainers
1
Weekly downloads
 
Created
Source

app

Node.js app wrapper

Installation

$ npm install @buzuli/app

Usage

const app = require('@buzuli/app')

const entry = async (context) => {
  // app entry point
}

const options = {
  unhandled: {
    sigint: { exit: false }
  }
}

app(entry, options)
// OR
app(options, entry)
// OR
app(options)(entry)

Options

Options may be pass as a second argument to customize behavior.

  • options.handle | forwarded to underlying @buzuli/unhandled package
  • options.logger | console-like logger object (logs via console built-in by default)
  • options.modules | every property is asynchronously resolved and injected

Context

The context object injects utilities and customizations/config into the entry point function.

  • context.logger | the configured logger
  • context.modules | resolved modules

Async module resolution and injection

Modules supplied via options.modules object are awaited and the resolved values injected under the same names in context.modules.

Signal and Error handling

Exit cleanly on return or exception by the entry function.

Logs and exits on (tunable via options.unhandled):

  • unhandled rejection
  • uncaught rejection
  • SIGINT
  • SIGTERM

Keywords

FAQs

Package last updated on 10 Jun 2022

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