# smiley

> A collection of useful Node.js functions and utilities.

Latest version **3.0.2** (published 2017-09-05) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2017-09-05 |
| First published | 2015-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mike Smiley |
| Maintainers | msmiley |
| Keywords | utilities, zeropad, isascii, hexdump |

## Links

- npm: https://www.npmjs.com/package/smiley
- Repository: https://github.com/msmiley/smiley
- Homepage: https://github.com/msmiley/smiley#readme
- Issues: https://github.com/msmiley/smiley/issues
- npm.io page: https://npm.io/package/smiley

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 3.0.2 (latest) — 2017-09-05
- 3.0.1 — 2017-09-03
- 3.0.0 — 2017-09-03
- 2.0.0 — 2017-08-30
- 0.4.0 — 2017-08-30
- 1.0.1 — 2016-12-02
- 1.0.0 — 2016-12-02
- 0.3.0 — 2016-12-02
- 0.2.2 — 2015-03-12
- 0.2.1 — 2015-03-12
- 0.2.0 — 2015-03-12
- 0.1.2 — 2015-01-15
- 0.1.1 — 2015-01-12

## README

# Smiley Library

A collection of useful Node.js functions and utilities.

These are functions I use often but are too simple to have their own package.

## Functions

### `zeroPad(string, totalLength) -> String`

Zero pad the given number into a string with the given total length.

### `hexDump(Buffer) -> String`

Render the bytes of the given Buffer to a hex-editor-like format.

### `isUUID(string) -> Boolean`

Uses a Regex to test the given string for the UUID format.

### `iecToDecimal(string) -> Number`

Converts an IEC size (e.g. 4.0K) to a full decimal Number (e.g. 4096)

### `titleCase(string) -> String`

Converts a string to Title Case. Hyphens and underscores are converted to spaces.

### `getNetworkInterfaces() -> Array`

Get an array of network interfaces in a different format than the typical `os.networkInterfaces()`. Makes traversing the interfaces easier.

### `getExternalIPAddress() -> String`

Return an IP address marked as external in `os.networkInterfaces()`. No guarantees about internet access.

### `findModuleRoot(moduleName) -> String`

Find the root of the given module defined as the first directory above the module's entry point with a `package.json` file.

### `debounce(function, waitMS, runImmediate) -> function`

Debounce the given function by preventing multiple executions within the given waitMS time. If runImmediate is true, the function will be executed immediately the first time.

## Installation

```bash
$ npm install smiley
```

## Testing

```bash
$ npm test
```

## License

  [MIT](LICENSE)

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