From e46d5dd04d7c60639b44fd3b1ec1fba1a4a14b55 Mon Sep 17 00:00:00 2001 From: garydavisonos Date: Wed, 22 Jan 2025 20:12:26 +0000 Subject: [PATCH] Improving Readme --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a0cce2..87a9399 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,56 @@ -# conditional-helpers +# Conditional Helpers -A collection of JavaScript helper functions to be used in conditional logic within projects +A collection of JavaScript helper functions to be used in conditional logic within projects. + +## Table of Contents + +- [Installation](#installation) +- [Usage](#usage) +- [Functions](#functions) +- [License](#license) + +## Installation + +To install the `conditional-helpers` package, run the following command in your terminal: + +```bash +npm install conditional-helpers +``` + +## Usage + +Import the conditional-helpers package in your JavaScript file and use the helper functions as needed. For example: + +```js +import { isString, isNumber, isArray } from "conditional-helpers"; + +console.log(isString("hello")); // true +console.log(isNumber(42)); // true +console.log(isArray([1, 2, 3])); // true +``` + +## Functions + +The following helper functions are available in the conditional-helpers package: + +- isArray: Checks if a value is an array. +- isBoolean: Checks if a value is a boolean. +- isBooleanFalsey: Checks if a boolean value is falsey. +- isBooleanTruthy: Checks if a boolean value is truthy. +- isDate: Checks if a value is a date. +- isFunction: Checks if a value is a function. +- isHTML: Checks if a value is an HTML string. +- isNumber: Checks if a value is a number. +- isObject: Checks if a value is an object. +- isObjectEmpty: Checks if an object is empty. +- isObjectHasProps: Checks if an object has properties. +- isString: Checks if a value is a string. +- isStringEmpty: Checks if a string is empty. +- isStringHasLength: Checks if a string has length. +- isArrayEmpty: Checks if an array is empty. +- isArrayHasLength: Checks if an array has length. +- hasLength: Checks if a value has length. + +## License + +The conditional-helpers package is licensed under the ISC license.