Gathering detailed insights and metrics for craydent-utility
Gathering detailed insights and metrics for craydent-utility
Gathering detailed insights and metrics for craydent-utility
Gathering detailed insights and metrics for craydent-utility
npm install craydent-utility
Typescript
Module System
Node Version
NPM Version
TypeScript (62.82%)
JavaScript (37.02%)
Shell (0.17%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
259 Commits
1 Watchers
2 Branches
2 Contributors
Updated on Aug 15, 2022
Latest Version
1.0.2
Package Id
craydent-utility@1.0.2
Unpacked Size
49.11 kB
Size
8.96 kB
File Count
22
NPM Version
10.5.2
Node Version
21.4.0
Published on
Sep 20, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
29
by Clark Inada
Craydent is all inclusive utility library. There are several ways to use the library in NodeJS. More detailed documentation on constants can be found at Craydent Properties. More detailed documentation on methods can be found at Craydent Methods
1// require with prototypes - this require will add prototypes to extend classes and add two constants ($c, $g) to the global space. 2// $g is an alias to global and $c is the constant containing all the utility methods and properties. 3require('craydent-utility'); 4$c.logit($c.VERSION); 5arr.prototypedMethod(args);
1// require no conflict - this require is the fully modular version with no global constants, prototypes, or methods. 2var $c = require('craydent-utility/noConflict'); 3$c.logit($c.VERSION); 4$c.prototypedMethod(arr, args);
1// require global - this require constants and methods in the global space and add prototypes to extend classes. 2// $g is an alias to global and $c is the constant containing all the utility methods and properties. 3require('craydent-utility/global'); 4logit($c.VERSION); 5arr.prototypedMethod(args);
CONSOLE_COLORS (Object) | LOCAL_IP (String) | TEMPLATE_TAG_CONFIG (Object) |
DEBUG_MODE (Boolean) | MODULES_LOADED (Object) | TEMPLATE_VARS (Array) |
ERROR_TYPES (Array) | PUBLIC_IP (String) | VERSION (String) |
HTTP_STATUS_TEMPLATE (Object) | RESPONSES (Object) |
Info: Creates an catch all for exceptions in the current node service.
Return: (void)
Parameters:
- callback: (ErrorCallback) Callback function to call when there is an uncaught exception
- append?: (Boolean) Options to defer, ignore case, etc
Overloads:
None
Info: Download a zip of files from file contents
Return: (String)
Parameters:
- files: (FileObject[]) Objects containing properties name for file name and content for file content
Overloads:
Parameters
- filename: (String) Name of the file
- content: (String) contents of the file
Info: Method to make retrieve the absolute path of the provided path
Return: (String)
Parameters:
- path: (String) Path to convert to the absolute path
Overloads:
None
Info: Method to extend the Object Class
Return: (void)
Parameters:
- name: (String) name of the method to add
- fn: (Function) method implementation
- override?: (Bool) if true, override the previously defined prototype
Overloads:
None
Info: Method to make ajax calls
Return: (Promise
Parameters:
- url: (String) End point url
- returnData?: (AjaxReturnType) Specifies which data to return when using Promise pattern
Overloads:
Parameters
- params: (AjaxOptions) specs with common properties:
(String) url
(String) dataType
(Mixed) hitch
(Function[]) onerror
(Function[])onsuccess- returnData?: (AjaxReturnType) Specifies which data to return when using Promise pattern
Info: Makes a value awaitable via a Promise.
Return: (Promise
Parameters:
- value: (AwaitableValue) Value to make awaitable
Overloads:
Parameters
- func: (Function) Function to make awaitable
- context: (any) Context to use to execute func.
Parameters
- func: (Function) Function to make awaitable
- callbackIndex: (Integer) Index of callback argument.
Parameters
- func: (Function) Function to make awaitable
- context: (any) Context to use to execute func.
- callbackIndex: (Integer) Index of callback argument.
Parameters
- func: (Function) Function to make awaitable
- context: (any) Context to use to execute func.
- callbackIndex: (Integer) Index of callback argument.
- returnIndex: (Integer) Index of callback argument.
Info: Clear a module from the require cache.
Return: (Bool)
Parameters:
- module?: (String) Single module to remove.
Overloads:
None
Info: Enable clustering
Return: (void)
Parameters:
- callback: (ClusterCallback) Method to call for Workers. Callback is passed the cluster object as an argument.
Overloads:
None
Info: Log to console when DEBUG_MODE is true and when the console is available
Return: (void)
Parameters:
- ...infinite: (any) any number of arguments can be passed.
Overloads:
None
Info: Creates a Craydent/Global Unique Identifier
Return: (String)
Parameters:
- msFormat?: (Bool) use microsoft format if true
Overloads:
None
Info: Exclude prototyping
Return: (void)
Parameters:
- list: (String[]) Array of strings in containing the property to exclude from prototyping.
Overloads:
None
Info: Place holder function for a blank function
Return: (void)
Parameters:
None
Overloads:
None
Info: Require without erroring when module does not exist.
Return: (any|false)
Parameters:
- path: (String) Module or Path to module.
- refresh?: (Bool) Flag to clear cache for the specific include.
Overloads:
None
Info: Check if a value is Null
Return: (Bool|any)
Parameters:
- value: (any) Value to check
Overloads:
Parameters
- value: (any) Value to check
- defaultValue: (any) Value to return if null
Info: Log to console when DEBUG_MODE is true and when the console is available
Return: (void)
Parameters:
- ...infinite: (any) any number of arguments can be passed.
Overloads:
None
Info: MD5 encode a string.
Return: (String)
Parameters:
- str: (String) String to encode.
Overloads:
None
Info: Recursively create folders.
Return: (void)
Parameters:
- path: (String) Path to create.
- callback: (Function) Method to call when directories are created (Gets passed error object as an argument and is null if there were no errors).
Overloads:
None
Info: Adds the class to a namespace instead of the global space
Return: (void)
Parameters:
- name: (String) Name of the namespace to add to.
- clazz: (Class) Class to add to the given namespace
- fn: (Function) Method to call after the class has been added to the namespace
Overloads:
None
Info: Place holder function for a blank function
Return: (void)
Parameters:
None
Overloads:
None
Info: Get the DateTime of now
Return: (Date|String)
Parameters:
- format?: (String) Format syntax to return formatted string of now
Overloads:
None
Info: Try to parse value to a Boolean (0, 1, '0', and '1' are valid unless strict is set to true).
Return: (Bool|undefined)
Parameters:
- value: (any) value to parse as boolean.
- strict?: (Boolean) Disable parsing of 0, 1, '0', and '1'.
Overloads:
None
Info: Creates an evaluable string
Return: (String)
Parameters:
- value: (any) value to parse
- skipQuotes?: (Bool) Flag to skip quotes for strings
- saveCircular?: (Bool) Flag to save circular references
Overloads:
None
Info: Create a random number between two numbers
Return: (Number)
Parameters:
- num?1: (Number) Lower bound
- num2?: (Number) Upper bound
- inclusive?: (Bool) Flag to include the given numbers
Overloads:
None
Info: Recursively require the entire directory and returns an object containing the required modules.
Return: (Promise
Parameters:
- path: (String) Path to directory.
- options?: (Char) 'r' Flag to use to indicate recursively require, (Char) 's' Flag to indicate use syncronous instead of Promise Pattern
Overloads:
None
Info: Executes array of methods
Return: (Bool)
Parameters:
- funcs: (Function[]) Array of methods to execute
- args: (any[]) Array of arguments to be passed to each method
Overloads:
None
Info: Creates a short Craydent/Global Unique Identifier
Return: (String)
Parameters:
- length?: (Integer) Custom length of the short unique identifier. Default is 10.
Overloads:
None
Info: Generator/Async based control flow to allow for more "syncronous" programing structure
Return: (Promise
Parameters:
- func: (GeneratorFunction|AsyncFunction) function to execute
Overloads:
None
Info: Evaluates an expression without throwing an error
Return: (any)
Parameters:
- expression: (any) Expression to evaluate
- evaluator?: (EvaluatorMethod) Method to use to evaluate the expression
Overloads:
None
Info: Stops execution until the condition is satisfied
Return: (void)
Parameters:
- condition: (Code) Condition equivalent to js true to resume execution
Overloads:
None
Info: Makes a value yieldable via a Promise.
Return: (Promise
Parameters:
- value: (YieldableValue) Value to make yieldable
Overloads:
Parameters
- func: (Function) Function to make yieldable
- context: (any) Context to use to execute func.
Parameters
- func: (Function) Function to make yieldable
- callbackIndex: (Integer) Index of callback argument.
Parameters
- func: (Function) Function to make yieldable
- context: (any) Context to use to execute func.
- callbackIndex: (Integer) Index of callback argument.
Parameters
- func: (Function) Function to make yieldable
- context: (any) Context to use to execute func.
- callbackIndex: (Integer) Index of callback argument.
- returnIndex: (Integer) Index of callback argument.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More