Skip to main content
formatWithOptions - node__util.d.ts - Node documentation
function formatWithOptions

Usage in Deno

```typescript import { formatWithOptions } from "node:node__util.d.ts"; ```
formatWithOptions(
inspectOptions: InspectOptions,
format?: any,
...param: any[],
): string
This function is identical to [format](../.././node__util.d.ts/~/format), except in that it takes an `inspectOptions` argument which specifies options that are passed along to [inspect](../.././node__util.d.ts/~/inspect). ```js util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); // Returns 'See object { foo: 42 }', where `42` is colored as a number // when printed to a terminal. ```

Parameters

inspectOptions: InspectOptions
optional
format: any
...param: any[]

Return Type

string