# think-helper

> Helper for ThinkJS

Latest version **1.3.0** (published 2026-08-07) · 0 weekly downloads

## Install

```sh
npm install think-helper
pnpm add think-helper
yarn add think-helper
bun add think-helper
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2026-08-07 |
| First published | 2017-02-20 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20.19.0 |
| Dependencies | 4 |
| Unpacked size | 23.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5266 |
| Author | songguangyu |
| Maintainers | lushijie, welefen, lizheming, songguangyu, sijiecai |

## Links

- npm: https://www.npmjs.com/package/think-helper
- Repository: https://github.com/thinkjs/thinkjs
- Homepage: https://github.com/thinkjs/thinkjs#readme
- Issues: https://github.com/thinkjs/think-helper/issues
- npm.io page: https://npm.io/package/think-helper

## Dependencies (4)

- [ms](https://npm.io/package/ms.md) ^2.1.3
- [pure-uuid](https://npm.io/package/pure-uuid.md) ^2.0.0
- [core-util-is](https://npm.io/package/core-util-is.md) ^1.0.3
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.2

## Recent versions

- 1.3.0 (latest) — 2026-08-07
- 1.2.0 — 2026-08-06
- 1.1.5 — 2026-05-29
- 1.1.4 — 2022-08-27
- 1.1.3 — 2021-06-30
- 1.1.2 — 2018-08-21
- 1.1.1 — 2018-05-28
- 1.0.23 — 2018-05-27
- 1.1.0 — 2018-05-21
- 1.0.22 — 2017-09-19
- 1.0.21 — 2017-08-30
- 1.0.20 — 2017-08-16
- 1.0.19 — 2017-08-16
- 1.0.18 — 2017-08-14
- 1.0.17 — 2017-08-09
- … 16 more at https://npm.io/package/think-helper/versions

## README

# think-helper
[![Build Status](https://travis-ci.org/thinkjs/think-helper.svg?branch=master)](https://travis-ci.org/thinkjs/think-helper)
[![Coverage Status](https://coveralls.io/repos/github/thinkjs/think-helper/badge.svg)](https://coveralls.io/github/thinkjs/think-helper)
[![npm](https://img.shields.io/npm/v/think-helper.svg)](https://www.npmjs.com/package/think-helper)

`think-helper` defines a set of helper functions for ThinkJS.

## Installation

Using npm:

```sh
npm install think-helper
```

In Node.js:

```js
import helper from 'think-helper';

let md5 = helper.md5('');

```

APIs:

API | Param | Description
---|---|---
`isInt` |  | check integer
`isIP` |  | check IP
`isIPv4`   |  | check IPv4
`isIPv6`   |  | check IPv6
`isMaster`   | |cluster.isMaster
`isArray`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Array
`isBoolean`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Boolean
`isNull`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an null
`isNullOrUndefined`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is null or undefined
`isNumber`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Number
`isString`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an String
`isSymbol`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Symbol
`isUndefined`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an undefined
`isRegExp`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an RegExp
`isObject`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Object
`isDate`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Date
`isError`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Error
`isFunction`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Function
`isPrimitive`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Primitive
`isBuffer`   | `arg`{mix}<br>`return`{Boolean} | check if a variable is an Buffer
`promisify`   |  `function`{function}<br>`receiver`{object}<br>`return` Promise  | make callback function to promise
`extend`   | `target`{object\|array}<br> `args`{Object\|Array}<br>`return`{Object} | extend object
`camelCase`   | `str`{string}<br>`return`{String} | make indexAction to index_action
`isNumberString`   | `str`{string} <br> `return`{Boolean} | check object is number string
`isTrueEmpty`   | `obj`{mixed} <br> `return`{Boolean}| truely
`isEmpty`   | `obj`{object}  <br> `return`{Boolean}| check object is mepty
`defer`   | `return` defer | get deferred object
`md5`   | `str`{string} <br> `return`{string} | get content md5
`timeout`   | `time`{Number} <br> `return` Promise | get timeout Promise
`escapeHtml`   | `str`{String}<br> `return` {string} | escape html
`datetime`   | `date`{Date\|String}<br>`format`{String}<br>`return`{String} | get datetime
`uuid`   | `version`{String} v1 or v4 | generate uuid
`isExist`   | `dir`{String} | check path is exist
`isFile`   | `filePath`{String} | check filepath is file
`isDirectory`   | `filePath`{String}  | check path is directory
`chmod`   | `path`{String}<br> `mode`{String}  | change path mode
`mkdir`   | `dir`{String}<br> `mode`{String} | make dir
`getdirFiles`   | `dir`{String}<br> `prefix`{String} | get files in path
`rmdir`   | `path`{String}<br> `reserve`{Boolean}<br>`return`{Promise} | remove dir async
`parseAdapterConfig` | `config`{Object}<br> `extConfig`{Object\|String} | parse adapter config
`ms` | `time`{String} | transform humanize time to ms
`omit` | `obj`{obj} <br> `prop` {String|Array} | omit object props

---
_Source: https://npm.io/package/think-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
