---
source_url: https://www.pubnub.com/docs/serverless/functions/functions-apis/utilities-module
title: Utilities Module
updated_at: 2026-06-26T11:07:39.749Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Utilities Module

The `utils` module provides utility helper methods.

This module is available via the following `require()` statement:

```javascript
const utils = require('utils');
```

## Random integer generator

Use the `randomInt()` method to generate a number between the given minimum and maximum values.

Usage: `randomInt(min, max)` where:

* `min`: lower integer limit (inclusive)
* `max`: upper integer limit (exclusive)

```javascript
const randomNumber = utils.randomInt(5, 15);
```

## isNumeric

Use the `isNumeric()` method to check if a variable is a number.

Usage: `isNumeric(variable)` where:

* `variable`: value to test

```javascript
console.log(utils.isNumeric(5)); // true
console.log(utils.isNumeric('five')); // false
```

:::note Functions support
Functions provides a rich set of tools, and this documentation may not cover every situation. If you need help with a case not covered here, please contact [PubNub Support](https://www.pubnub.com/docs/mailto:support@pubnub.com).
:::