GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - devjs1000/dev-handler: dev handler is library for handling the functions and controller with inbuilt fast testing with it.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
node_modules
node_modules
 
 
api.js
api.js
 
 
fn.js
fn.js
 
 
index.js
index.js
 
 
node.js
node.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 

Repository files navigation

EXAMPLE

handleThis({
  name: "create user",
  errMsg: "failed to create user",
  type: "api",
  errorCode: 500,
  senders: { req, res },
  expectedOnPass: "ok",
  expectedOnFailed: 0,
  onSuccess: () => {
    console.log("yeah");
  },
  onFailed: () => {
    console.log("ops");
  },
  fn: async () => {
    const { userName, password } = req.body;
    const usr = new User({ userName, password });
    await usr.save();
    let data = {};
    res.send({ status: true, msg: "Success", data });
    return "ok";
  },
});

##OPTIONS

name : function name or use;
fn : main async fn;
type : api or fn;
note : default is fn;
errMsg : message on error;
note: this is required;
senders : {req, res};
note: only required in apis;
returnOnPass : value will be returned on pass;
note: this value  will be returned on pass of your fn;
returnOnFailed : value will be return on fail;
note: this value  will be returned on fail of your fn;
onSuccess : this function will be called on success;
note: this is optional;
onFailed : this function will be called on failure;
note: this is optional;
expectedOnPass: expected return value on success from your main fn;
note: this is optional but recommended;
expectedOnFailed: expected return value on failure from your main fn;
note: this is optional but recommended;

About

dev handler is library for handling the functions and controller with inbuilt fast testing with it.

Topics

handlerjsnodejstestingtesting-toolstrycatch

Resources

Readme
Activity

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.