typeof NodeInspectSymbolDefines the symbol used by Node.js for custom object inspection.
When to use
Use to implement Node.js custom inspection for a value.
Details
This symbol is recognized by Node.js's util.inspect() function and the REPL
for custom object representation. When an object has a method with this symbol,
it will be called to determine how the object should be displayed.
Example (Defining custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("hello")
console.log(obj) // Displays: CustomObject(hello)export const const NodeInspectSymbol: typeof NodeInspectSymbolDefines the symbol used by Node.js for custom object inspection.
When to use
Use to implement Node.js custom inspection for a value.
Details
This symbol is recognized by Node.js's util.inspect() function and the REPL
for custom object representation. When an object has a method with this symbol,
it will be called to determine how the object should be displayed.
Example (Defining custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("hello")
console.log(obj) // Displays: CustomObject(hello)
The type of the Node.js inspection symbol used for custom object inspection.
This symbol type is used to implement custom inspection behavior in Node.js
environments.
When to use
Use to type methods keyed by the Node.js custom inspection symbol.
Example (Typing custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("test")
console.log(obj) // CustomObject(test)
NodeInspectSymbol = var Symbol: SymbolConstructorSymbol.SymbolConstructor.for(key: string): symbolReturns a Symbol object from the global symbol registry matching the given key if found.
Otherwise, returns a new symbol with this key.
for("nodejs.util.inspect.custom")
/**
* The type of the Node.js inspection symbol used for custom object inspection.
* This symbol type is used to implement custom inspection behavior in Node.js
* environments.
*
* **When to use**
*
* Use to type methods keyed by the Node.js custom inspection symbol.
*
* **Example** (Typing custom Node inspection)
*
* ```ts
* import { Inspectable } from "effect"
*
* class CustomObject {
* constructor(private value: string) {}
*
* [Inspectable.NodeInspectSymbol]() {
* return `CustomObject(${this.value})`
* }
* }
*
* const obj = new CustomObject("test")
* console.log(obj) // CustomObject(test)
* ```
*
* @category symbols
* @since 2.0.0
*/
export type type NodeInspectSymbol =
typeof NodeInspectSymbol
Defines the symbol used by Node.js for custom object inspection.
When to use
Use to implement Node.js custom inspection for a value.
Details
This symbol is recognized by Node.js's util.inspect() function and the REPL
for custom object representation. When an object has a method with this symbol,
it will be called to determine how the object should be displayed.
Example (Defining custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("hello")
console.log(obj) // Displays: CustomObject(hello)
The type of the Node.js inspection symbol used for custom object inspection.
This symbol type is used to implement custom inspection behavior in Node.js
environments.
When to use
Use to type methods keyed by the Node.js custom inspection symbol.
Example (Typing custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("test")
console.log(obj) // CustomObject(test)
NodeInspectSymbol = typeof const NodeInspectSymbol: typeof NodeInspectSymbolDefines the symbol used by Node.js for custom object inspection.
When to use
Use to implement Node.js custom inspection for a value.
Details
This symbol is recognized by Node.js's util.inspect() function and the REPL
for custom object representation. When an object has a method with this symbol,
it will be called to determine how the object should be displayed.
Example (Defining custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("hello")
console.log(obj) // Displays: CustomObject(hello)
The type of the Node.js inspection symbol used for custom object inspection.
This symbol type is used to implement custom inspection behavior in Node.js
environments.
When to use
Use to type methods keyed by the Node.js custom inspection symbol.
Example (Typing custom Node inspection)
import { Inspectable } from "effect"
class CustomObject {
constructor(private value: string) {}
[Inspectable.NodeInspectSymbol]() {
return `CustomObject(${this.value})`
}
}
const obj = new CustomObject("test")
console.log(obj) // CustomObject(test)
NodeInspectSymbol