# utilx

> Some tiny tool functions.

Latest version **0.1.0** (published 2015-01-21) · 0 weekly downloads

## Install

```sh
npm install utilx
pnpm add utilx
yarn add utilx
bun add utilx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-01-21 |
| First published | 2014-04-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | fool2fish |
| Maintainers | fool2fish |
| Keywords | tool |

## Links

- npm: https://www.npmjs.com/package/utilx
- Repository: https://github.com/fool2fish/utilx
- Issues: https://github.com/fool2fish/utilx/issues
- npm.io page: https://npm.io/package/utilx

## Dependencies (2)

- [colorful](https://npm.io/package/colorful.md) ~2.1.0
- [iconv-lite](https://npm.io/package/iconv-lite.md) ~0.4.4

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-01-21
- 0.0.9 — 2014-10-22
- 0.0.8 — 2014-09-19
- 0.0.7 — 2014-07-11
- 0.0.6 — 2014-06-28
- 0.0.5 — 2014-05-07
- 0.0.4 — 2014-04-22
- 0.0.3 — 2014-04-21
- 0.0.2 — 2014-04-20
- 0.0.1 — 2014-04-14

## README

# utilx

Some tiny tool functions.

### home

{String} the home path

### isArray(o)

### isString(o)

### isNonEmptyString(o)

### isNumber(o)

### isInteger(o)

### split(str, delim = ',')

```
split([])  =>  []
split('1,2,3') => [1, 2, 3]
split('1,,2,,3', ',,')  => [1, 2, 3]
```

### camelcase(str)

```
camelcase('is-array')  =>  'isArray'
```

### unCamelcase(str)

```
unCamelcase('isArray')  => 'is-array'
```

### isExistedFile(p)

### isExistedDir(p)

### readFile(p, encoding = 'utf8')

### writeFile(p, data)

This function will create the dir first if necessary.

### remove(p)

Remove specified dir or file. If the path is not existing, this function will do nothing.

### readJSON(p)

This function will return an empty JSON object if any error occurs.

### writeJSON(p, data, space = 0)

### noCacheRequire(fullPath)

### mix(target, src, overwrite = false)

Mix properties form src to target.

Multiple src is ok, e.g: `var target = mix(target, src1, src2, src3)`

### getExternalIpAddress()

### generateLine(len, symbol = '-')

```
generateLine(4)  =>  '----'
generateLine(2, '=*')  =>  '=*=*'
```

### cGetCfg(commander)

Get options from parsed commander.

```
var commander = require('commander')
commander.parse(process.argv)
var cfg = cGetCfg(commander)
```

### cGetHelp(pkg)

Return a function to generate help info for commander.

```
var commander = require('commander')
var pkg = require('../package')
commander.helpInfomation = cGetHelp(pkg)
```

### isUrl(p)

### isKeyword(p)

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