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

Usage in Deno

```typescript import { isString } from "node:node__util.d.ts"; ```
isString(object: unknown): object is string
Deprecated
Since v4.0.0 - Use `typeof value === 'string'` instead.
Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. ```js import util from 'node:util'; util.isString(''); // Returns: true util.isString('foo'); // Returns: true util.isString(String('foo')); // Returns: true util.isString(5); // Returns: false ```

Parameters

object: unknown

Return Type

object is string