# quote-it

> Safe quoting a given string without adding duplicate quotes

Latest version **1.0.1** (published 2018-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install quote-it
pnpm add quote-it
yarn add quote-it
bun add quote-it
```

## 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 | 1.0.1 |
| Published | 2018-08-20 |
| First published | 2018-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | imcuttle |
| Maintainers | moyuyc |
| Keywords | quote-it |

## Links

- npm: https://www.npmjs.com/package/quote-it
- Repository: https://github.com/imcuttle/quote-it
- Homepage: https://github.com/imcuttle/quote-it#readme
- Issues: https://github.com/imcuttle/quote-it/issues
- npm.io page: https://npm.io/package/quote-it

## Recent versions

- 1.0.1 (latest) — 2018-08-20
- 1.0.0 — 2018-08-20

## README

# quote-it

[![build status](https://img.shields.io/travis/imcuttle/quote-it/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/quote-it)
[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/quote-it.svg?style=flat-square)](https://codecov.io/github/imcuttle/quote-it?branch=master)
[![NPM version](https://img.shields.io/npm/v/quote-it.svg?style=flat-square)](https://www.npmjs.com/package/quote-it)
[![NPM Downloads](https://img.shields.io/npm/dm/quote-it.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/quote-it)

Safe quoting a given string without adding duplicate quotes

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### quote

[index.js:46-57](https://github.com/imcuttle/quote-it/blob/51c020b78f020f7e6c89352a2807342631bf3b7e/index.js#L46-L57 'Source code on GitHub')

Uses `quoteChar` to wrap string.

#### Parameters

- `string` {string}
- `quoteChar` {string}

#### Examples

```javascript
import quote from 'quote-it'
quote('abc', "'") === "'abc'"
```

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### single

[index.js:68-70](https://github.com/imcuttle/quote-it/blob/51c020b78f020f7e6c89352a2807342631bf3b7e/index.js#L68-L70 'Source code on GitHub')

Uses single quote to wrap string.

#### Parameters

- `string`

#### Examples

```javascript
import { single } from 'quote-it'
single("a'bc") === "'a'bc'"
```

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

### double

[index.js:78-80](https://github.com/imcuttle/quote-it/blob/51c020b78f020f7e6c89352a2807342631bf3b7e/index.js#L78-L80 'Source code on GitHub')

Uses double quote to wrap string.

#### Parameters

- `string`

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

## License

MIT

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