empty-fields

1.0.5 • Public • Published

empty-fields

A Node.js package that checks whether a given fields array null or empty.

Usage

First, install the package using npm:

npm install empty-fields --save

Then, require the package and use it like so:

var emptyFields = require('empty-fields');

var params = req.body;
var first_name = params.first_name,  
    last_name = params.last_name,
    email = params.email,
    password = params.password;

var fieldsToCheck = [first_name, last_name, email, password];
console.log(emptyFields(fieldsToCheck)); // false  

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i empty-fields

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

1.34 kB

Total Files

3

Last publish

Collaborators

  • manprajapat