-
-
Notifications
You must be signed in to change notification settings - Fork 1
Functions
-
jsl.isEmpty()
Checks whether or not a variable is considered "empty" (equal to null, undefined, an empty string or an object with length = 0).
-
jsl.isArrayEmpty()
Does the same check as jsl.isEmpty(), but on every item of an array.
-
jsl.error()
Logs a colored error message to the console and/or to a file and optionally exits the process.
-
jsl.allEqual()
Tests an array on whether or not all items are equal.
-
jsl.softShutdown()
Synchronously executes a function before the process shuts down.
-
jsl.noShutdown()
Prevents the process from being exited normally.
-
jsl.yesShutdown()
Allows the process to be shut down again if previously disabled by jsl.noShutdown().
-
jsl.readableArray()
Stringifies an array and makes it better readable.
-
jsl.mapRange()
Transforms a value of one numerical range to a value of another numerical range.
-
jsl.unused()
Indicates an unused variable to a linter without modifying the variable.
-
jsl.replaceAt()
Replaces a character at the specified index of a string with another string.
-
jsl.randRange()
Generates highly randomized numbers from a passed numerical range.
-
jsl.randomizeArray()
Randomizes the items inside an array and returns it.
-
jsl.randomItem()
Returns a random item of an array.
-
jsl.seededRNG.generateSeededNumbers()
Generates a set of numbers based on a seed. As long as the seed stays the same, the random numbers will be the same, no matter when and how the function is executed.
-
jsl.seededRNG.generateRandomSeed()
Generates a seed to be used in jsl.generateSeededNumbers()
-
jsl.seededRNG.validateSeed()
Checks whether or not a seed is valid (useful for validating user entered seeds).
-
jsl.generateUUID.hexadecimal()
Generates a hexadecimal [0-9,A-F] UUID based on a format string.
-
jsl.generateUUID.decimal()
Generates a decimal [0-9] UUID based on a format string.
-
jsl.generateUUID.alphanumerical()
Generates an alphanumerical [0-9,A-Z] UUID based on a format string.
-
jsl.generateUUID.binary()
Generates a binary [0-1] UUID based on a format string.
-
jsl.generateUUID.custom()
Generates a UUID with a custom charset based on a format string.
-
jsl.ping()
Pings a URL and returns the status code, MIME type and response time.
-
jsl.downloadFile()
Downloads a file from a URL.
-
jsl.logger()
Logs a string to a file with an optional timestamp.
-
jsl.readdirRecursive()
Asynchronously recursively reads a directory, returning an array of all subdirectories and files.
-
jsl.readdirRecursiveSync()
Does the same thing as jsl.readdirRecursive(https://github.com/Sv443/JSLib-npm/blob/master/docs/features/functions.md#readdirrecursive), but synchronously.