# @writetome51/to-str

> Function returns arg as string. Fastest way to convert to string

Latest version **0.0.1** (published 2020-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @writetome51/to-str
pnpm add @writetome51/to-str
yarn add @writetome51/to-str
bun add @writetome51/to-str
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-09-02 |
| First published | 2020-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | convert, to, as, string, strings, str, function |

## Links

- npm: https://www.npmjs.com/package/@writetome51/to-str
- Repository: https://github.com/writetome51/to-str
- Homepage: https://github.com/writetome51/to-str#readme
- Issues: https://github.com/writetome51/to-str/issues
- npm.io page: https://npm.io/package/@writetome51/to-str

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2020-09-02

## README

# toStr(arg): string

Returns `arg` as string (I know, durr).  
81% faster than <code>String(arg)</code>.  
62% faster than <code>\`${arg}\`</code>.  
(Tested at  https://jsbench.me/)


## Examples
```js
import {toStr} from '@writetome51/to-str';

toStr(1);
// --> '1'

toStr(0.001);
// --> '0.001'

toStr(-0.001);
// --> '-0.001'

toStr(-0);
// --> '0'

toStr(false);
// --> 'false'

toStr([]);
// --> ''

toStr([1, 2, 3, [4]]);
// --> '1,2,3,4'

toStr();
// --> 'undefined'

typeof toStr();
// --> 'string'
```

## Installation
`npm i  @writetome51/to-str`

## Loading
```js
import {toStr} from '@writetome51/to-str';
```

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