# min-quote

> Minimally Quote a String. Avoid Extra Escape Characters.

Latest version **0.2.0** (published 2022-11-06) · CC0-1.0 license · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2022-11-06 |
| First published | 2021-04-19 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | apostrophe, backtick, double-apostrophe, min, quote, string |

## Links

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

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2022-11-06
- 0.1.0 — 2022-11-06
- 0.0.0 — 2021-04-19

## README

# min-quote
Minimally Quote a String.  Avoid Extra Escape Characters.

## motivation
Code that escapes a quote in a string with a backslash includes an extra character (8 bits).
This library aims to avoid the extra backslash by choosing `"`, `'`, or <code>`</code>
depending on if a quoting character is in the string.  This is especially helpful
if you have a JavaScript file with thousands of strings. 

## install
```bash
npm install min-quote
```

## basic usage
```js
import minQuote from 'min-quote';

minQuote('The cow jumped over the moon');
// 'The cow jumped over the moon'

minQuote("It's awesome.");
// "It's Awesome"

minQuote(`"Don't count the days, make the days count." - Muhammad Ali`);
// `"Don't count the days, make the days count." - Muhammad Ali`
```

## advanced usage
Turn off the use of backticks for quoting:
```js
minQuote(`"Don't count the days, make the days count." - Muhammad Ali`, { backtick: false });
// '"Don\'t count the days, make the days count." - Muhammad Ali'
```

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