1.0.3 • Published 4 years ago

codeutil v1.0.3

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

CodeUtil

Module with some useful functions to help and simplify your code.

Functions

random(a) ⇒

Return a random array item.

Kind: global function
Returns: any

ParamTypeDescription
aArrayArray to get a random item

Example

require('codeutil').Array.random(['abc', '123'])

random(max) ⇒ Number

Return a random number following the max number restriction

Kind: global function

ParamTypeDescription
maxNumbermax number

Example

require('codeutil').Number.random()

random() ⇒ String

Will return a random string

Kind: global function
Example

require('codeutil').String.random()

toProperCase(str, start) ⇒ String

Modify the string to start with an upper case

Kind: global function

ParamTypeDefaultDescription
strStringstring to get modified
startBooleanfalsedefines whether all words will start with a capital letter (false = no)

Example

require('codeutil').String.toProperCase('hi abc no') // Hi abc no
require('codeutil').String.toProperCase('hi abc no', true) // Hi Abc No
1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago