Options
All
  • Public
  • Public/Protected
  • All
Menu

Module crt

A module containing miscellaneous functionality for error reporting, platform functionality, and package-wide logic.

Index

System Functions

crt_version

  • crt_version(): any
  • Returns the AWS CRT version

    Returns any

is_browser

  • is_browser(): boolean
  • Returns true if this script is running in a browser

    Returns boolean

is_nodejs

  • is_nodejs(): boolean
  • Returns true if this script is running under nodejs

    Returns boolean

native_memory

  • native_memory(): number
  • If the AWS_CRT_MEMORY_TRACING is environment variable is set to 1 or 2, will return the native memory usage in bytes. Otherwise, returns 0.

    Returns number

    The total allocated native memory, in bytes.

native_memory_dump

  • native_memory_dump(): void
  • Dumps outstanding native memory allocations. If the AWS_CRT_MEMORY_TRACING environment variable is set to 1 or 2, will dump all active native memory to the console log.

    Returns void

package_info

  • package_info(): any
  • Returns the package information for aws-crt-nodejs

    Returns any

using

  • using<T>(resource: T, func: (resource: T) => void): Promise<void>
  • Use this function to create a resource in an async context. This will make sure the resources are cleaned up before returning.

    Example:

    await using(res = new SomeResource(), async (res) =>  {
        res.do_the_thing();
    });

    Type parameters

    Parameters

    • resource: T
    • func: (resource: T) => void
        • (resource: T): void
        • Parameters

          • resource: T

          Returns void

    Returns Promise<void>

Generated using TypeDoc