craydent-class
v1.0.2
Published
Node module implementing addition classes for functionality and to simplify code for maintainability and readability
Downloads
49
Maintainers
Readme
Craydent 1.0.2
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
// require with prototypes - this require will add prototypes to extend classes and add two constants ($c, $g) to the global space.
// $g is an alias to global and $c is the constant containing all the utility methods and properties.
require('craydent-class');
$c.logit($c.VERSION);
arr.prototypedMethod(args);
// require no conflict - this require is the fully modular version with no global constants, prototypes, or methods.
var $c = require('craydent-class/noConflict');
$c.logit($c.VERSION);
$c.prototypedMethod(arr, args);
// require global - this require constants and methods in the global space and add prototypes to extend classes.
// $g is an alias to global and $c is the constant containing all the utility methods and properties.
require('craydent-class/global');
logit($c.VERSION);
arr.prototypedMethod(args);
Categories
Constants
| | | | | ----- | ----- | ----- | | 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) |
Methods
Class
Benchmarker
Info: Class used to measure the run time of code
Return: (IBenchmarker)
Parameters:
None
Overloads:
None
CArray
Info: Class used wrap Array to enable chaining without polluting the the prototypes
Return: (CArray)
Parameters:
- arr?: (Array|IndexedArray) Array argument used in the original constructor
- duplicate?: (Boolean) Flag to copy the array. Defaults to true
Overloads:
None
CDate
Info: Class used wrap Date to enable chaining without polluting the the prototypes
Return: (CDate)
Parameters:
- date?: (Date) Date argument used in the original constructor
Overloads:
None
CFunction
Info: Class used wrap Function to enable chaining without polluting the the prototypes
Return: (CFunction)
Parameters:
- fn?: (GeneratorFunction|AsyncGeneratorFunction|AsyncFunction|Function) Function argument used in the original constructor
Overloads:
None
CNumber
Info: Class used wrap String to enable chaining without polluting the the prototypes
Return: (CNumber)
Parameters:
- number?: (Number) Number argument used in the original constructor
Overloads:
None
CObject
Info: Class used wrap Object to enable chaining without polluting the the prototypes
Return: (CObject)
Parameters:
- obj?: (Object) Object argument used in the original constructor
Overloads:
None
CRegExp
Info: Class used wrap RegExp to enable chaining without polluting the the prototypes
Return: (CRegExp)
Parameters:
- pattern: (String|RegExp) RegExp pattern used in the original constructor
- flags?: (String) RegExp flags used in the original constructor
Overloads:
None
CString
Info: Class used wrap String to enable chaining without polluting the the prototypes
Return: (CString)
Parameters:
- str: (String) String argument used in the original constructor
Overloads:
None
Cursor
Info: Cursor class to facilitate iteration
Return: (ICursor)
Parameters:
- records: (Array) Array used to create the iterator to iterate each item
Overloads:
Parameters
- records: (Object) Object used to create the iterator to iterate each property
OrderedList
Info: Collection class that filters out duplicate values and maintains an ordered list
Return: (IOrderedList)
Parameters:
None
Overloads:
Parameters
- records?: (Array) Array used to create the initial items in the ordered list
- sorter?: (SortIterator) Function for sorting logic
Queue
Info: Collection class that follows FIFO
Return: (IQueue)
Parameters:
- records: (Array) Array used to create the iterator to iterate each item
Overloads:
None
ServerManager
Info: Class used to create a new context for HTTP server
Return: (void)
Parameters:
- request: (HTTPRequest) HTTP request object provided by createServer
- response: (HTTPResponse) HTTP response object provided by createServer
Overloads:
None
Set
Info: Collection class that filters out duplicate values
Return: (ISet<T, TResult>)
Parameters:
- records: (Array) Array used to create the iterator to iterate each item
Overloads:
None
Download
- GitHub
- BitBucket
- GitLab Craydent is released under the Dual licensed under the MIT or GPL Version 2 licenses.