1.2.5 • Published 3 years ago

coding-help v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Coding-Help-Module

npm npm GitHub Lines of code

NPM

Get features that NodeJS doesn't provide!

Installation

To install, simply run the following command.

$ npm install coding-help

To use this in your project, you can simply use require.

const codingHelp = require("coding-help");

Strings

Strings is, so far, the largest section of the Coding Help module. It features many exciting methods to help you with strings!

Table

See the table to look for commands in the string section.

CommandDescription
betweenGet a part of a word between the left and right from a string.
toCamelCaseConvert a string to camel case.
toTitleCaseConvert a string to title case.
removeWhitespaceRemove extra spaces in a string with single spaces, and spaces out of the string with none.
toTitleCaseConvert a string to title case.
containsWordSee if a string contains a word. Unline includes(), this method checks if there is a word, not a part of a word.
countWordOccurencesCount the amount of word occurences there are in a string. Be aware that this method only counts word occurences.
createHTMLTagCreate a HTML tag, with the tag name, the content, and the attributes.
padStringPad the string from the start and end with the desired length and characters on each side of the string.
repeatRepeat a string a specified number of times.
urlNameMakes a string a valid URL name. It preforms the following operations on the string before returning it.
removeLatinRemove all Latin letters in a string. BETA
replaceAllReplace all occurences in a string. This is similar to ES2021's method replaceAll.
removePunctuationRemove all punctuation from a string.
templateAdd variables to specified template punctuation. This is like ES6's/ES2021's template literal (except more customizable)!

Numbers

The numbers part is helpful for working with number types!

Table

See the table for you to see what commands are available in the numbers section.

CommandDescription
removeDecimalRemove the decimal point of a number.
countDigitsCount the amount of each digit, from 0-9, in a number.
lengthOfNumberGet the length of a number.
integerSee if a number is an integer.
toOrdinalConvert a number to an ordinal (e.g. 78 into 78th).

Booleans

The boolean part is helpful for boolean tasks. Right now, there isn't much, but soon, more will come!

Table

See the table below to look for commands in booleans.

CommandDescription
findStatusSee if a value is greater than, less than, or equal to another value.
isNothingSee if a value is nothing, according to JavaScript.

Array

Arrays are helpful for storing data. This small array section will get your jobs with arrays done faster!

Table

See the table for commands in array.

CommandDescription
toReadableStringConvert an array to a human-readable string.
flattenFlatten nested arrays to one whole non-nested array.
forEachLoop over each element in an array. This is like Array.prototype.forEach().

Validator

The validator makes it easier to validate user input, data, and much more!

Table

See the table for information of commands in the validator section.

CommandDescription
validateEmailValidate an email.
validatePasswordValidate a password. BETA
isAlphaSee if a string is alpha (contains only letters).
isAlphaNumericSee if the string is numeric alpha (contains only letters and numbers).
isEmptySee if the string is empty.
isLowerOnlyCheck if a string contains only lower case characters.
isUpperOnlyCheck if a string contains only uppercase characters.
isNumericOnlyCheck if a string is numeric only, with some conditions.
isCurrencySee if a currency is valid or not.
isEqualSee if two strings are identical.
isASCIISee if a string contains ASCII.
isBaseCheck if a string is Base32 or Base64 encoded.
isHexColourCheck if a string is a 3 or 6-digit hex colour code.
isCaseCheck if a string is upper or lower case only. Ignores numbers and symbols.
isURLCheck if a string is a valid URL.

Math

The math part of the Coding Help module is very helpful for doing mathematics activities!

Table

See the table below to look for the commands in the math section.

CommandDescription
PIThis is a variable which represents the ratio of the circumference of a circle to its diameter.
EThe mathematical constant E. This is Euler's number, the base of natural logarithms.
addAdd multiple numbers together.
subtractSubtract multiple numbers together in order.
multiplyMultiply multiple numbers together in order.
divideDivide multiple numbers in the order passed in.
powerGet the power of multiple numbers together.
randNumGet a random number from a minimum number to a maximum number.
getMaxNumGet the maximum number from a list of numbers.
getMinNumGet the minimum number from a list of numbers. This number is dependent on getMaxNum!
avgGet the average number from a list of numbers.
compassToDegreesConvert a compass heading (e.g. S), and convert it to degrees. Set to be moved!
removeDecimalRemove the decimal from a number. This is helpful if you want to convert a float to an integer. Set to be moved!

Documentation

Right now, unfortunately, there is no documentation for this module.

But, if there are many total downloads, a documentation website may come out!

More coming soon!

Soon, we are going to provide more functionality many more areas in NodeJS, to make your code easier to read and quicker to write!