basic error handling module for node basic projects
npm install nodeinputerrorhandlertypescript and javascript
npm i nodeinputerrorhandler
`
$3
`typescript
import {errorInstance} from 'nodeinputerrorhandler';
`
$3
`javascript
const {errorInstance} = require('nodeinputerrorhandler');
`
$3
`typescript and javascript
const errorString = errorInstance.commonGeneralError({string: ['John Doe'], number: [1, 4, 77771818]}, {role: 'admin', setRole: 'admin'});
if(errorString){
return console.log(errorString)
}
var stringLengthError = errorInstance.stringLengthError({string: ['This is to test for short string inputs such as name, location, etc']}, {shortMinLength: 3, shortMaxLength: 20}, {longMinLength: 45, longMaxLength: 500} {longString: ['This is a a test for strings that you are looking to test for long strings such as blog posts, about section, etc. ']});
if(stringLengthError){
return console.log(stringLengthError)
}
``