0.1.1-alpha • Published 3 years ago

datadancer v0.1.1-alpha

Weekly downloads
24
License
ISC
Repository
-
Last release
3 years ago

DataDancer

What is DataDancer?

DataDancer provides you with methods to easily get various data.

Representative function is Name Generator, Password Generator, getRanRangeNum Method on NumberMethods.

You can also receive data of various data types through DataDancer to receive other types of data or refined data.

You can also get the calculated value of standard deviation, variance, etc.,

you can sort the array or remove the middle element of the array and get the array elements randomly,

for Date type object you can add month, day to Date object and you can get the day of the week.

Docs Site

site

If you want to know how to use, parametric, return type, etc.,

Please refer to the documentation site.

There is a music player on the document site so that you can learn without getting bored.

Enjoy!

DataDancer Docs

npm

DataDancer npm

Install

$ npm i datadancer

How to use?

import DataDancer from 'datadancer';

// Create a class with the methods you want to use
const am = new DataDancer.ArrayMethods();
const sm = new DataDancer.StringMethods();
const nm = new DataDancer.NumberMethods();
const vm = new DataDancer.VisualMethods();
const dm = new DataDancer.DateMethods();

API

ArrayMethods

MethodParameter / Type / isOptionalReturnTypeDetail
quickSort1. arr / Array / false, 2. key / string / trueArrayThis is quick sort.You can also sorting object array by key.
binarySearch1. arr / Array / false, 2. search / any / false key / string / trueObject{ idx: number(array index), val: Any }It is a search function that allows you to quickly search in an array sorted in ascending order.You can also search object array by key.
linearSearch1. arr / Array / false, 2. search / any / false key / string / trueObject{ idx: number(array index), val: Any }It is a search function that allows you to quickly search in an array sorted in ascending order.You can also search object array by key.
getRanElement1. arr / Array / false, 2. howMany / number / trueAny | Any ArrayIf you want to get the elements of an array randomly, use getRanElement. It is also possible to get multiple random elements of an array.
rmMiddleArrIdx1. arr / Array / false, 2. target / numbernumber[] / falseArrayIf you want to remove the middle element of an array, use rmMiddleArrIdx.It is also possible to remove multiple middle elements of an array.

DateMethods

MethodParameter / Type / isOptionalReturnTypeDetail
addDays1. date / Date / false, 2. dates / number / falseDateadd Day to Date type Object.
addMonth1. date / Date / false, 2. months / number / falseDateadd months to Date type Object.
addYear1. date / Date / false, 2. years / number / falseDateadd years to Date type Object.
dateCompare1. fastDate / Date / false, 2. latestDate / Date / falseBooleanIf you have 2 Date Type Object, dateCompare function gives you which date is latest.
getDayOfWeek1. date / Date / false, 2. lang / "eng" or "kor" or "jp" or "chi" or "india" or "hindi" or "german" / trueStringIf you want to get day of the week to String type, use getDayOfWeek. Can be obtained by language
getFormDate1. date / Date / false, 2. form / string / falseStringIf you want to get Date Type Object to String with your own Custom Form use getFormDate Function.

NumberMethods

MethodParameter / Type / isOptionalReturnTypeDetail
sum1. arr / Number Array / falseNumberIf you want to get sum value of number array, use sum function
avarage1. arr / Number Array / falseNumberIf you want to get avarage value of number array, use avarage function
deviation1. arr / Number Array / falseObject{ origin: array(entered Array), avarage: number(avarage value), deviation: number(deviation value) }If you want to get deviation value of number array, use deviation function
variance1. arr / Number Array / falseNumberIf you want to get variance value of number array, use variance function
standardDeviation1. arr / Number Array / falseObject{ variance: number(variance value), standardDeviation: number(standardDeviation value) }If you want to get standardDeviation value of number array, use standardDeviation function
getMinMax1. arr / Number Array / falseObject{ min: number(minimum value), max: number(maximum value) }If you want to get minimum and maximum value of number array, use getMinMax function
getRanDigitNum1. digit / Number / false2. isString / Boolean / true3. zeroFixBackDigit / Number / trueNumber | StringIf you want to get number of fixed digit randomly, use getRanDigitNum function
getRanRangeNum1. start / Number / false2. end / Number / falseNumberIf you want to get number from a to b randomly, use getRanRangeNum function

StringMethods

MethodParameter / Type / isOptionalReturnTypeDetail
nameGenerator1. lang / "kor" or "eng" or "jp" or "chi" or "india" or "hindi" or "german" / true2. gender / "male" or "female" / trueStringIf you want get name Randomly, use sum nameGenerator function.Default language value is English, Default gender value is maleYou can also set the language and gender.Supported Language: English, Korean, Japan, Chinese, India, Hindi, GermanSupported Gender: English, Japan, Chinese, India, Hindi, German
passwordGenerator1. digit / Number / false2. include / "all" or "string" or "number" or "symbol" / trueStringIf you want get password Randomly, use sum passwordGenerator function.Password must be set at least 4 digits.Default return password value is only inludes String.If you want to inlude number or symbol or both in password,you can also set itCan Include: Number, Symbol

VisualMethods

MethodParameter / Type / isOptionalReturnTypeDetail
colorGenerator1. type / "rgb" or "code" / trueStringIf you want to get Color randomly, use colorGenerator
gradientGenerator1. direction / "to right" or "to left" or "to top" or "to bottom"/ trueStringIf you want to get gradient randomly, use gradientGenerator