qqquick
v1.0.41
Published
JavaScript package that reduces repetitive code by providing pre-built functions for common tasks like status codes, random names, codes, dates, etc... It simplifies development, especially for smaller projects
Downloads
8
Maintainers
Readme
qqquick is a JavaScript package that provides pre-built functions for handling status codes, generating random names, codes, dates & etc... It aims to reduce the amount of repetitive code developers need to write, saving time and making development more efficient, particularly for small to medium-sized projects.
Anyone who has any ideas, or feedback please email: [email protected]
How to use?
Here is the tree of the functions available in the qqquick object:
help: Provides information about the qqquick library. It contains only one property about which gives a brief description of what qqquick is.
status: Contains HTTP status codes and their associated messages. It contains properties for common HTTP status codes (e.g., 200, 404, etc.) and a detailed property with more descriptive messages for each code.
date: Formats the current date/time in the specified format. It takes one optional argument 'format', which specifies the desired date format using 'SS''NN''HH''DD''MM''YYYY'. If no argument is provided, it returns the current date/time object.
generate: Contains several functions that generate random strings, codes, names, passwords, etc. It includes the following functions:
- code: generates a random number code of a given length.
- randomString: generates a random string of a given length.
- letterCode: generates a random alphanumeric code of a given length.
- name: generates a random name from a predefined list (90 Names).
- fullName generates a random Fullname from 2 predefined lists (7200 combinations)
- animal: generates a random animal names from a predefined list (154 animals)
- password: generates a random password of a given length.
- check: Contains functions that check if a value is a string and calculates the age based on a birthdate.
- uuid: generates a quick 'Universally Unique Identifier', note: it is not cryptographically secure, so it's good fo non-security-critical use cases
check: Contains functions to check things, such as ages, strings, birthdates.
- ifString: checkes is input is a string
- ifEmail: checks if a string is an email
- ifUrl: checks if a string is a URL
- ifPhoneNumber: checks if a string is a phonenumber (US format)
Verify: Contains functions used to verify things:
- birthdate: returns the age of a birthdate provided in a 'DD/MM/YYYY' format
- age: checks if a age is greater than specified number (Default 18)
format: Contains functions that format strings in various ways. It includes the following functions:
- currency: formats a number as currency. Params:'amount, symbol, decimal'.
- removeWhitespace: removes all whitespace from a string.
- titleCase: formats a string as title case.
math: Contains mathematical functions:
- factorial: calculates the factorial of a number
- median: calculates the median of an array of numbers
- average: calulates the average of an array of numbers
- round:
- decimal: rounds number to the nearest decimal point
- multiple: round number to the nearest multiple
- smallest: finds the smallest of an array of numbers
- largest: finds the largest of an array of numbers
array: contains functions to help manage arrays
- removeDuplicates: removes any duplicates within the array
- filter: filters the array to return something in specific
- sort: ranks the array from lowest to highest. & for string, shortet to longest (only first word)
string: contains functions to help manage strings
- trim: trims any space around a string
- pad: adds padding characters to a string, either at the beginning, the end, or both sides.
- spit: splits up a a string, good for if a user input may contains tags in this format ('comedy, action, fiction'), split can split each word in to an array item
- replace: replaces a word in a string
To use qqquick, simply import the object into your JavaScript file and call the desired function(s) using the syntax 'qqquick.functionName()'. For example, to generate a random password of length 10, you could use the following code: 'qqquick.generate.password(10)';
What's New (1.0.4)
Generate:
- fullName: generates a random Fullname from 2 predefined lists (7200 combinations)
- animal: generates a random animal names from a predefined list (154 animals)
- UPDATE name: now can generate up to 90 predefined names