Wondering what’s next for npm?Check out our public roadmap! »

    craydent-control-flow
    TypeScript icon, indicating that this package has built-in type declarations

    0.12.0 • Public • Published

    Craydent 0.12.0

    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-control-flow');
    $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-control-flow/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-control-flow/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

    Control Flow


    awaitable


    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.

    syncroit


    Info: Generator/Async based control flow to allow for more "syncronous" programing structure

    Return: (Promise)

    Parameters:

    • func: (GeneratorFunction|AsyncFunction) function to execute

    Overloads:

    None


    yieldable


    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.

    Download

    Install

    npm i craydent-control-flow

    DownloadsWeekly Downloads

    7

    Version

    0.12.0

    License

    MIT

    Unpacked Size

    21.3 kB

    Total Files

    30

    Last publish

    Collaborators

    • avatar