Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "util"

Index

Functions

_extend

  • _extend<T, U>(target: T, source: U): T & U
  • The util._extend() method was never intended to be used outside of internal Node.js modules. The community found and used it anyway.

    It is deprecated and should not be used in new code. JavaScript comes with very similar built-in functionality through Object.assign().

    deprecated

    Type parameters

    • T

    • U

    Parameters

    • target: T
    • source: U

    Returns T & U

debug

  • debug(string: string): void

debuglog

  • debuglog(section: string): function
  • The util.debuglog() method is used to create a function that conditionally writes debug messages to stderr based on the existence of the NODE_DEBUG environment variable. If the section name appears within the value of that environment variable, then the returned function operates similar to console.error(). If not, then the returned function is a no-op.

    Parameters

    • section: string

    Returns function

      • (msg: any, ...args: any[]): void
      • Parameters

        • msg: any
        • Rest ...args: any[]

        Returns void

deprecate

  • deprecate<T>(fn: T, string: string): T
  • The util.deprecate() method wraps the given function or class in such a way that it is marked as deprecated.

    Type parameters

    • T

    Parameters

    • fn: T
    • string: string

    Returns T

error

  • error(...strings: string[]): void

format

  • format(format: any, ...param: any[]): string
  • The util.format() method returns a formatted string using the first argument as a printf-like format.

    Parameters

    • format: any
    • Rest ...param: any[]

    Returns string

inherits

  • inherits(constructor: any, superConstructor: any): void
  • Inherit the prototype methods from one constructor into another. The prototype of constructor will be set to a new object created from superConstructor.

    Parameters

    • constructor: any
    • superConstructor: any

    Returns void

isArray

  • isArray(object: any): boolean

isBoolean

  • isBoolean(object: any): boolean

isBuffer

  • isBuffer(object: any): boolean

isDate

  • isDate(object: any): boolean

isError

  • isError(object: any): boolean

isFunction

  • isFunction(object: any): boolean

isNull

  • isNull(object: any): boolean

isNullOrUndefined

  • isNullOrUndefined(object: any): boolean
  • Returns true if the given object is null or undefined. Otherwise, returns false.

    deprecated

    Parameters

    • object: any

    Returns boolean

isNumber

  • isNumber(object: any): boolean

isObject

  • isObject(object: any): boolean
  • Returns true if the given object is strictly an Object and not a Function. Otherwise, returns false.

    deprecated

    Parameters

    • object: any

    Returns boolean

isPrimitive

  • isPrimitive(object: any): boolean

isRegExp

  • isRegExp(object: any): boolean

isString

  • isString(object: any): boolean

isSymbol

  • isSymbol(object: any): boolean

isUndefined

  • isUndefined(object: any): boolean

log

  • log(string: string): void
  • The util.log() method prints the given string to stdout with an included timestamp.

    deprecated

    Parameters

    • string: string

    Returns void

print

  • print(strings: string[]): void

puts

  • puts(strings: string[]): void

Generated using TypeDoc