{{ app_conf.environment }}

{{ crookse.package_name }}

Latest Release {{ crookse.latest_release }}

Last updated: {{ date_last_updated.datetime }} | View changes on GitHub

Reference


Notes

Each section has the following subsections:

  • Purpose: The code's purpose.
  • Type: The code's data type.
  • Parameters: If the code is a function/method, then the parameters it uses.
  • Throws: If the code is a function/method and throws errors, then the details of what it throws and when.
  • Returns: If the code is a function/method and returns something, then the details of what it returns and when.
  • Example Usage: Example(s) of how to use the code.
  • Notes: Information about the code that users should know before using the code.

Table of Contents

Note: Items in black have their documentation text in progress.

CrookseNode
+-- Applications
+-- Dictionary
|   +-- HttpStatusCodes
+-- Exception
|   +-- HttpException_{code}(message)
|       +-- p:message
+-- Logger
|   +-- BaseLogger(configs)
|   |   +-- id
|   |   +-- level
|   |   +-- beforeLog()
|   |   +-- debug()
|   |   +-- error()
|   |   +-- fatal()
|   |   +-- info()
|   |   +-- trace()
|   |   +-- warn()
|   +-- ConsoleLogger(configs)
|   +-- FileLogger(configs)
+-- Loggers
+-- Server(configs)
|   +-- p:configs
|   +-- addHttpResources(resources)
|   |   +-- p:resources
|   +-- addStaticPath(staticPath, staticPathHttpRequestHandler)
|   |   +-- p:staticPath
|   |   +-- p:staticPathHttpRequestHandler
|   +-- attachNewDataMembersToRequest(request, response)
|   |   +-- p:request
|   |   +-- p:response
|   +-- attachNewDataMembersToResponse(request, response)
|   |   +-- p:request
|   |   +-- p:response
|   +-- createConsoleLogger()
|   +-- createNodeServer()
|   +-- getRequestRequestedResponseOutput()
|   +-- getResourceClass()
|   +-- getResponseContentType()
|   +-- getStaticPathObject()
|   +-- handleHttpRequest(request, response)
|   |   +-- p:request
|   |   +-- p:response
|   +-- handleHttpRequestError(request, response)
|   |   +-- p:request
|   |   +-- p:response
|   +-- log(level, message, object)
|   |   +-- p:level
|   |   +-- p:message
|   |   +-- p:object
|   +-- nodeServerListenCallback()
|   +-- nodeServerOnRequestCallback()
|   +-- run()
|   +-- setRequestTypeName(request, options = {})
|   |   +-- p:request
|   |   +-- p:options
+-- Servers
+-- Utils
|   +-- colorize(message, options)
|   |   +-- p:message
|   |   +-- p:options
|   +-- defineObjectConstant(object, constantName, constantValue)
|   |   +-- p:object
|   |   +-- p:constantName
|   |   +-- p:constantValue
|   +-- getNestedPropertyValue(object, ...properties)
|       +-- p:object
|       +-- p:...properties
+-- addApplication(name, application)
|   +-- p:name
|   +-- p:application
+-- addLogger(name, logger)
|   +-- p:name
|   +-- p:logger
+-- createServer(configs)
|   +-- p:configs
+-- logError(location, message)
|   +-- p:location
|   +-- p:message
+-- logInfo(message)
|   +-- p:message
+-- logSuccess(message)
|   +-- p:message
+-- logWarn(location, message)
    +-- p:location
    +-- p:message

Purpose

CrookseNode.Applications is a storage variable for applications (e.g., npm packages, helper classes, service classes, or any other "thing" that you consider an application). Applications are added to this namespace through the use of CrookseNode.addApplication(). The application that is passed to CrookseNode.addApplication() is stored in CrookseNode.Applications and accessible as CrookseNode.Applications.{ApplicationName}. This namespace is useful if you need a way for your applications to access each other without having to know each other.

Type

Object

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

  • Adding two applications that call each other:
    1. Setup your server file.
    2. Access MyApplicationTwo from MyApplicationOne
    3. Access MyApplicationOne from MyApplicationTwo

Notes

None.


Purpose

Provides a namespace for dictionaries of data. {{ crookse.package_name }} comes with the following dictionaries:

  • CrookseNode.Dictionary.HttpStatusCodes

Note: This namespace can be used to store any dataset that you create outside of {{ crookse.package_name }}.

Type

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

N/A

Notes

N/A


Purpose

Provides Node's http.STATUS_CODES collection of all the standard HTTP response status codes, but expands the value for each code. This is useful if you do comparisons with response status codes, output standard response messages, or want to grab the response's code or short description in a semantic way (e.g., CrookseNode.Dictionary.HttpStatusCodes['200'].short_description instead of http.STATUS_CODES['200'] to get the response's short description). See code below to see how raw Node.js differs from {{ crookse.package_name }}:

Type

Parameters

N/A

Throws

N/A

Returns

Object (see below)

Example Usage

Notes

None.


Purpose

Provides a namespace for exception classes. {{ crookse.package_name }} comes with the following exception classes:

  • CrookseNode.Exception.HttpException_{code}

Note: This namespace can be used to store any exception class that you create outside of {{ crookse.package_name }}.

Type

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

N/A

Notes

N/A


Purpose

Provides a semantic way of throwing exceptions related to HTTP response codes. Below is the list of all HttpException classes:

  • CrookseNode.Exception.HttpException_100
  • CrookseNode.Exception.HttpException_101
  • CrookseNode.Exception.HttpException_102
  • CrookseNode.Exception.HttpException_103
  • CrookseNode.Exception.HttpException_200
  • CrookseNode.Exception.HttpException_201
  • CrookseNode.Exception.HttpException_202
  • CrookseNode.Exception.HttpException_203
  • CrookseNode.Exception.HttpException_204
  • CrookseNode.Exception.HttpException_205
  • CrookseNode.Exception.HttpException_206
  • CrookseNode.Exception.HttpException_207
  • CrookseNode.Exception.HttpException_208
  • CrookseNode.Exception.HttpException_226
  • CrookseNode.Exception.HttpException_300
  • CrookseNode.Exception.HttpException_301
  • CrookseNode.Exception.HttpException_302
  • CrookseNode.Exception.HttpException_303
  • CrookseNode.Exception.HttpException_304
  • CrookseNode.Exception.HttpException_305
  • CrookseNode.Exception.HttpException_307
  • CrookseNode.Exception.HttpException_308
  • CrookseNode.Exception.HttpException_400
  • CrookseNode.Exception.HttpException_401
  • CrookseNode.Exception.HttpException_402
  • CrookseNode.Exception.HttpException_403
  • CrookseNode.Exception.HttpException_404
  • CrookseNode.Exception.HttpException_405
  • CrookseNode.Exception.HttpException_406
  • CrookseNode.Exception.HttpException_407
  • CrookseNode.Exception.HttpException_408
  • CrookseNode.Exception.HttpException_409
  • CrookseNode.Exception.HttpException_410
  • CrookseNode.Exception.HttpException_411
  • CrookseNode.Exception.HttpException_412
  • CrookseNode.Exception.HttpException_413
  • CrookseNode.Exception.HttpException_414
  • CrookseNode.Exception.HttpException_415
  • CrookseNode.Exception.HttpException_416
  • CrookseNode.Exception.HttpException_417
  • CrookseNode.Exception.HttpException_418
  • CrookseNode.Exception.HttpException_421
  • CrookseNode.Exception.HttpException_422
  • CrookseNode.Exception.HttpException_423
  • CrookseNode.Exception.HttpException_424
  • CrookseNode.Exception.HttpException_425
  • CrookseNode.Exception.HttpException_426
  • CrookseNode.Exception.HttpException_428
  • CrookseNode.Exception.HttpException_429
  • CrookseNode.Exception.HttpException_431
  • CrookseNode.Exception.HttpException_451
  • CrookseNode.Exception.HttpException_500
  • CrookseNode.Exception.HttpException_501
  • CrookseNode.Exception.HttpException_502
  • CrookseNode.Exception.HttpException_503
  • CrookseNode.Exception.HttpException_504
  • CrookseNode.Exception.HttpException_505
  • CrookseNode.Exception.HttpException_506
  • CrookseNode.Exception.HttpException_507
  • CrookseNode.Exception.HttpException_508
  • CrookseNode.Exception.HttpException_509
  • CrookseNode.Exception.HttpException_510
  • CrookseNode.Exception.HttpException_511

Type

Parameters

Throws

N/A

Returns

N/A

Example Usage

  • Sending a response based on an error type:

    Note: This shows how the {CrookseNode.Server}.handleHttpRequestError() method can be overridden to check what error types were thrown and to send an appropriate response based on an error's type.

  • Throwing 401 (Unauthorized) error in a resource class because of an Account ID mismatch:

Notes

None.


Purpose

Provides a namespace for logger classes. {{ crookse.package_name }} comes with the following logger classes:

  • CrookseNode.Logger.BaseLogger
  • CrookseNode.Logger.ConsoleLogger
  • CrookseNode.Logger.FileLogger

Note: This namespace can be used to store any logger classes that you create outside of {{ crookse.package_name }}.

Type

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

  • Adding your own logger class and using it:
    1. Define your new logger class and add a new instance of it to CrookseNode.Loggers.
    2. In another file, require the package and call the logger object's logInfo() method.

Notes

N/A


Purpose

This class serves as the parent class for:

  • CrookseNode.Logger.ConsoleLogger
  • CrookseNode.Logger.FileLogger

Type

Parameters

Throws

  • Error
    • Thrown if its configs specify an invalid log level. Valid log levels are:
      • all
      • trace
      • debug
      • info
      • warn
      • error
      • fatal
      • off

      Note: You can provide the level as a lowercase string or uppercase string.

  • ReferenceError
    • Thrown if its log() method isn't defined. This class' log() method can be overridden and this error will be thrown if overridden incorrectly.

Returns

Note: You can construct an object of this class, but this class is only used to house common methods between child classes.

Example Usage

N/A

Notes

None.


Purpose

Provides a way to write tagged logs in the console.

Type

(child of CrookseNode.Logger.BaseLogger)

Note: This is a class (a.k.a. constructor function).

Parameters

  • Note: Below is the sample config file's contents. This file includes all of the accepted configs. You can view the sample config file here: config.logger.console-logger.js.

Throws

  • Error
    • Thrown if its configs specify an invalid log level. Valid log levels are:
      • all
      • trace
      • debug
      • info
      • warn
      • error
      • fatal
      • off

      Note: You can provide these levels as lowercase strings or uppercase strings.

  • ReferenceError
    • Thrown if its log() method isn't defined. This class' log() method can be overridden and this error will be thrown if overridden incorrectly.

Returns

Example Usage

Notes

None.


Purpose

Provides a way to write tagged logs to a file.

Type

(child of CrookseNode.Logger.BaseLogger)

Note: This is a class (a.k.a. constructor function).

Parameters

  • Note: Below is the sample config file's contents. This file includes all of the accepted configs. You can view the sample config file here: config.logger.file-logger.js.

Throws

  • Error
    • Thrown if its configs specify an invalid log level. Valid log levels are:
      • all
      • trace
      • debug
      • info
      • warn
      • error
      • fatal
      • off

      Note: You can provide these levels as lowercase strings or uppercase strings.

  • ReferenceError
    • Thrown if its log() method isn't defined. This class' log() method can be overridden and this error will be thrown if overridden incorrectly.

Returns

Example Usage

Notes

None.


Purpose

CrookseNode.Loggers is a storage variable that later serves as a namespace for loggers (if loggers are added). When CrookseNode.addLogger() is used, the logger being passed to CrookseNode.addLogger() is stored in CrookseNode.Loggers and accessible as CrookseNode.Loggers.{LoggerName}. This namespace along with CrookseNode.addLogger() is useful if you need a way to access your loggers in your codebase.

Type

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

(in progress)

Notes

None.


Purpose

This class exists to help you construct an object that creates Node's http.Server object. The differences between {{ crookse.package_name }}'s server and raw Node's server are the data members that {{ crookse.package_name }}'s server has defined. These data members help you further control Node's HTTP requests, responses, and errors; and to control them all in one place.

Type

Note: This is a class (a.k.a. constructor function).

Parameters

  • Note: Below is the sample config file's contents. This file includes all of the accepted configs. You can view the sample config file here: config.server.js.

Throws

  • Error
    • Thrown when adding resources and a resource class doesn't have a name.
  • Error
    • Thrown when adding resources and a duplicate resource class is provided.
  • ReferenceError
    • Thrown when adding resources and the resource class isn't provided.

Returns

Example Usage

  • Creating a CrookseNode.Server object:

Notes

  • You can construct a CrookseNode.Server object on your own, but it is recommended that you use CrookseNode.createServer() because it includes logic that prevents you from writing bad configs.

Purpose

This method adds the HTTP resources to the server by mapping paths (a.k.a. URIs) to resource class constructors (a.k.a. constructor functions). It allows a CrookseNode.Server object to handle HTTP requests at given paths. When a CrookseNode.Server object handles an HTTP request at a given path, it looks for the resource class constructor that is mapped to the given path and constructs a resource class object using the resource class constructor that it finds. The resource class object then handles the HTTP request via one of its HTTP methods (e.g., HTTP_GET_JSON(), HTTP_GET_HTML(), HTTP_POST_HTML(), etc.). The HTTP method used is based on the HTTP request type. The HTTP request type is determined by the HTTP request's method type and requested response output.

Examples:

  • If the HTTP request method is GET and the requested response output is JSON, then the HTTP method that will be called from the resource object will be HTTP_GET_JSON().
  • If the HTTP request method is GET and the requested response output is HTML, then the HTTP method that will be called from the resource object will be HTTP_GET_HTML().
  • If the HTTP request method is POST and the requested response output is JSON, then the HTTP method that will be called from the resource object will be HTTP_POST_JSON().
  • If the HTTP request method is POST and the requested response output is HTML, then the HTTP method that will be called from the resource object will be HTTP_POST_HTML().

If the HTTP method that should be called from the resource object isn't found in the resource object, then (by default) a 405 (Method Not Allowed) response will be sent.

Type

Parameters

    • If Array is passed: An array of resource data.
    • If Object is passed: An associative array of resource data.
    • If String is passed: The path to the resources directory.

Throws

Nothing.

Returns

Nothing.

Example Usage

  • Adding HTTP resources using an array:
  • Adding HTTP resources using an object:
  • Adding HTTP resources using a string:
  • Adding HTTP resources using require:

    Note: Files that are required as modules via require MUST export the paths and the resource class constructor (a.k.a. constructor function). When the server starts adding HTTP resources, it will look for and only parse this data structure: { paths: [ '/' ], class: [Function: IndexResource] }. You can add more keys to the exported object, but paths and class are required. The only exception to this requirement is if you've overridden how HTTP resources are added to the server and no longer require paths and class.

    1. Setup your server file.
    2. Setup your resource file.

      Note: Remember, paths and class must be exported.

Notes

  • This method calls {CrookseNode.Server}.addHttpResource() to (1) add the resource's info to the {CrookseNode.Server}.Resource namespace and (2) associate the resource's paths to {CrookseNode.Server}.router.
  • Resource classes MUST have a name. Their names are stored in the {CrookseNode.Server}.Resource namespace for referencing during HTTP request handling. Example below:

Purpose

This method add a static path and the function (a.k.a. the handler) that handles the request-response cycle for requests to the static path. Static paths are also known as static routes. Static paths are useful when some requests need to be routed to paths that don't change. For example, the path to a style.css file could be /assets/css/style.css. The style.css file's path is static and should be added as a static path.

Type

Parameters

    • The static path.
    • The static path's HTTP request handler. This handler handles the GET requests to the static path.

Throws

  • Error
    • Thrown if the staticPath argument has a trailing slash.

Returns

Nothing.

Example Usage

  • Serve static paths using serve-static.
  • Serving static paths without serve-static.

Notes

None.


Purpose

Attaches new members to the request object for better request-response handling. The following members are attached to the request object:

    • A placeholder for a request's path params (if any). Path params are defined in a resource's array of given paths (e.g., paths: ['/accounts/:account_id', /accounts/:account_id/users]).
    • The Url object that gets returned from calling url.parse(`${server.URL}${request.url}`, true);.
    • A object of key-value pairs that hold the request's URL query params and their values.
    • The request's requested response output (e.g., json).
    • Gets a URL query param value from the request object's URL query param string.
    • Gets a request object's pathname param value.

Type

Parameters

    • The request object.
    • The response object.

Throws

Nothing.

Returns

This method adds new members to the request object (by reference), but it also returns the request object if a returned object is required.

Example Usage

Notes

None.


Purpose

Attaches new members to the response object for better request-response handling. The following members are attached to the response object:

    • The request object (for accessibility purposes).
    • A placeholder for the response's body.

Type

Parameters

    • The request object.
    • The response object.

Throws

Nothing.

Returns

This method adds new members to the response object (by reference), but it also returns the response object if a returned object is required.

Example Usage

Notes

None.


Purpose

Creates the server's console logger.

Type

Parameters

None.

Throws

Nothing.

Returns

Nothing.

Example Usage

By default, this method is called in the {CrookseNode.Server}.run() method. Before calling {CrookseNode.Server}.run(), you can override the method so that the server uses your method.

Notes

None.


Purpose

Creates the server's Node.js server.

Type

Parameters

None.

Throws

Nothing.

Returns

Nothing.

Example Usage

By default, this method is called in the {CrookseNode.Server}.run() method. Before calling {CrookseNode.Server}.run(), you can override the method so that the server uses your method.

Notes

The nodeServerListenCallback() method is dependent on this method, so if you override this method, then be sure to make it in line with the requirements of nodeServerListenCallback() (or override nodeServerListenCallback()). The nodeServerListenCallback() method is as follows:


Purpose

Handle an HTTP request. By default, this method is mapped to the server's default_handleHttpRequest() method.

Type

Parameters

    • The request object.
    • The response object.

Throws

(in progress)

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

Handle an errors thrown in the request-response cycle.

Type

Parameters

    • The request object.
    • The response object.

Throws

(in progress)

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

Log a message to the console using the logger created in {CrookseNode.Server}.createConsoleLogger().

Type

Parameters

(in progress)

Throws

(in progress)

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

This method is called in {CrookseNode.Server}.run(). It's only purpose is to be separated from the run() method so that it can be tested.

Type

Parameters

(in progress)

Throws

(in progress)

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

This method is called in {CrookseNode.Server}.run(). It's only purpose is to be separated from the run() method so that it can be tested.

Type

Parameters

(in progress)

Throws

(in progress)

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

This method creates the console logger, creates the Node.js server, allows the Node.js server to listen on the specified hostname and port, and allows the Node.js to handle HTTP requests. This method is defined as follows:

Type

Parameters

None.

Throws

Nothing.

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

Sets the request object's type as its TYPE_NAME constant.

Type

Parameters

    • The message to colorize.
    • An associative array of options. Default is an empty object.

      Note: Below is the list of accepted options.

        • Default is false. When set to false, the TYPE_NAME will be `HTTP_${request.method.toUpperCase()}_${request.requested_response_output.toUpperCase()}`
        • If set to true, then the TYPE_NAME will be set to HTTP_GET (because resources retrieved from static paths should only allow GET requests).

Throws

Nothing.

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

CrookseNode.Servers is a storage variable that later serves as a namespace for servers when servers are created. When the CrookseNode.createServer() function is used, the server created by the function is stored in CrookseNode.Servers and accessible as CrookseNode.Servers.{id}.

Type

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

N/A

Notes

N/A


Purpose

Provides a namespace for utility functions. {{ crookse.package_name }} comes with the following utility functions:

  • CrookseNode.Utils.colorize()

Note: This namespace can be used to store any function that you create outside of {{ crookse.package_name }}.

Type

Parameters

N/A

Throws

N/A

Returns

N/A

Example Usage

N/A

Notes

N/A


Purpose

Provides a way to colorize text in the console by prepending an escape sequence (e.g., \x1b[30mHello).

Type

Parameters

    • The message to colorize.
    • An associative array of options.

      Note: Below is the list of accepted configs.

      • color:
        • black
        • red
        • green
        • yellow
        • blue
        • magenta
        • cyan
        • white
        • default
      • background-color:
        • black
        • red
        • green
        • yellow
        • blue
        • magenta
        • cyan
        • white
        • default
      • font-style:
        • reset
        • bright
        • dim
        • standout
        • underscore
        • blink
        • reverse
        • hidden

Throws

Nothing.

Returns

Example Usage

  • Outputting green text:
  • Outputting red text:

Notes

N/A


Purpose

Provides a way to define constant-like properties on objects by performing the following:

 Object.defineProperty(object, constantName, {
   configurable: false,
   value: constantValue,
   writable: false,
 });

Type

Parameters

    • The object getting the constant.
    • The constant's name. This will be retrievable as {object}.CONSTANT_NAME.
    • The constant's value.

Throws

Nothing.

Returns

Nothing.

Example Usage

(in progress)

Notes

(in progress)


Purpose

Provides a way to get the value of a deeply nested property in an object.

Type

Parameters

    • The object containing the deeply nested property.
    • The rest of the arguments as strings to use as property names when finding the nested property's value. The last argument that the rest parameter finds is the nested property you are targeting.

Throws

Nothing.

Returns

Example Usage

(in progress)

Notes

(in progress)


Purpose

Allows applications to be added to the CrookseNode.Applications namespace so that they can easily access each other.

Type

Parameters

    • The name of the application. The name will be used as the identifier in CrookseNode.Applications (e.g, CrookseNode.Applications.MyApplicationName).
    • The application (e.g., an npm package, a helper class, a service class, or any other "thing" that you consider an application).

Throws

Nothing.

Returns

Nothing.

Example Usage

  • Adding two applications that call each other:
    1. Setup your server file.
    2. Access MyApplicationTwo from MyApplicationOne
    3. Access MyApplicationOne from MyApplicationTwo

Notes

None.


Purpose

Allows loggers to be added to the CrookseNode.Loggers namespace so that they can be accessed easily.

Type

Parameters

    • The name of the logger. The name will be used as the identifier in CrookseNode.Loggers (e.g, CrookseNode.Loggers.MyLoggerName).
    • The logger. This could be a CrookseNode.Logger.ConsoleLogger object, a CrookseNode.Logger.FileLogger object, or a logger that you made or are using.

Throws

Nothing.

Returns

Nothing.

Example Usage

  • Adding a console logger:
    1. Setup your server file.
    2. Access the logger and call a log method.

Notes

None.


Purpose

This function constructs a CrookseNode.Server object.

Type

Parameters

    • If Object is passed: The server's configs. See CrookseNode.Server to see all of the accepted configs.
    • If String is passed: A server ID/name. The default hostname and port will be localhost:1337 if a string is passed.

Throws

Nothing.

Returns

Example Usage

  • Creating a server by passing in a string.
  • Creating a server by passing in configs.

Notes

  • It is recommended that you use this function. You don't have to, but it is recommended because it includes logic that prevents you from writing bad configs.

Purpose

This function creates red error messages, logs them to the console, and exits the node process.

Note: This function calls process.exit().

Type

Parameters

    • The location (e.g., the name of the function/method that calls this function) of where the log message occurred.
    • The log message to write to the console.

Throws

Nothing.

Returns

Nothing.

Example Usage

Notes

  • This function is mainly used in crookse.Node's index.js file as a preventive measure–called when one of the CrookseNode functions (addApplication(), addLogger(), and createServer()) is called incorrectly.
  • All log messages are prefixed with [crookse.Node] (e.g, [crookse.Node] This is my log message.).

Purpose

This function creates plain messages and logs them to the console.

Type

Parameters

    • The log message to write to the console.

Throws

Nothing.

Returns

Nothing.

Example Usage

Notes

  • This function is mainly used in crookse.Node's index.js file to provide informative messages in the console.
  • All log messages are prefixed with [crookse.Node] (e.g, [crookse.Node] This is my log message.).

Purpose

This function creates green messages and logs them to the console.

Type

Parameters

    • The log message to write to the console.

Throws

Nothing.

Returns

Nothing.

Example Usage

Notes

  • This function is mainly used in crookse.Node's index.js file to provide informative success messages in the console.
  • All log messages are prefixed with [crookse.Node] (e.g, [crookse.Node] This is my log message.).

Purpose

This function creates yellow messages and logs them to the console.

Type

Parameters

    • The location (e.g., the name of the function/method that calls this function) of where the log message occurred.
    • The log message to write to the console.

Throws

Nothing.

Returns

Nothing.

Example Usage

Notes

  • This function is mainly used in crookse.Node's index.js file to provide informative warning messages in the console.
  • All log messages are prefixed with [crookse.Node] (e.g, [crookse.Node] This is my log message.).