0.0.1 • Published 4 years ago

simple-object-handler v0.0.1

Weekly downloads
28
License
MIT
Repository
github
Last release
4 years ago

Simple Object Handler

CircleCI GitHub license

Table of Contents

  1. Intro
  2. Why should you use
  3. Installation
  4. Usage
  5. Tests
  6. License

1. Intro

The idea of Simple Object Handler it came with a necessity of make simple functions in a manner of be easier to read and easily handle objects in a way which hasn't as a native functions in JavaScript. It would be possible with these functions to handle objects such as check is empty or not, a lenght of keys or params, clean/remove all empty params (considering empty string, null or undefined), get an array of all keys or params values and much more.

2. 🚀 Why should you use ?

  1. Create a better readable code;
  2. Dry your code and avoid reuse many ifs or long Object functions from JavaScript.
  3. Light library.
  4. Easy to install.

3. 📦 Installation

  npm install simple-object-handler

4. 📖 Usage

You can find at simple-object-handler the functions:

  • isObjectEmpty
  • isObjectNotEmpty
  • objectKeys
  • objectValues
  • countObjectKeys
  • countObjectValues
  • isObject
  • isParamEmpty
  • removeEmptyFieldsFromObject
  // You can use simply desconstructor way
  const {
    isObjectEmpty
    isObjectNotEmpty
    objectKeys
    objectValues
    countObjectKeys
    countObjectValues
    isObject
    isParamEmpty
    removeEmptyFieldsFromObject
    } = require('simple-object-handler');

Would you like to know an example in how to use those functions ? Take a look at the wiki, there you can find an example of all that list of functions.

5. 📄 Tests

You can find more examples how to use the library in test folder.

You can run the applications tests with

  npm test

6. 📄 License

Simple Object Handler is MIT licensed.