New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

express-catch-errors

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-catch-errors

A high-order function to catch errors from promises.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

express-catch-errors

Generated by OSS Project Generator.

NPM Version License

A high-order function to catch errors from promises.

Installation

Install package

$ npm install --save express-catch-errors

Usage

  • Router
// user.router.js
const userController = require('./user.controller');

router.get('/users', catchErrors(userController.list));
  • Controller
// user.controller.js
const mongoose = require('mongoose');
const User = mongoose.model('User');

module.exports.list = async (req, res) => {
  const users = await User.find();

  res.json(users);
};

Development

  • Cloning the repo
$ git clone https://github.com/robertoachar/express-catch-errors.git
  • Installing dependencies
$ npm install
  • Running scripts
ActionUsage
Starting development modenpm start
Linting codenpm run lint

Author

Roberto Achar

License

MIT

Keywords

node

FAQs

Package last updated on 28 Sep 2017

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