# escape-quotes

> Adds a backslash before single quotes in a string (or whichever characters you like)

Latest version **1.0.2** (published 2016-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install escape-quotes
pnpm add escape-quotes
yarn add escape-quotes
bun add escape-quotes
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-03-30 |
| First published | 2016-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/escape-quotes) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Dolan |
| Maintainers | mgduk |
| Keywords | escape, escape quotes, quote, addslash, slash, addslashes |

## Links

- npm: https://www.npmjs.com/package/escape-quotes
- Repository: https://github.com/mgduk/escape-quotes
- Homepage: https://github.com/mgduk/escape-quotes#readme
- Issues: https://github.com/mgduk/escape-quotes/issues
- npm.io page: https://npm.io/package/escape-quotes

## Dependencies (1)

- [escape-string-regexp](https://npm.io/package/escape-string-regexp.md) ^1.0.5

## Recent versions

- 1.0.2 (latest) — 2016-03-30
- 1.0.1 — 2016-03-30
- 1.0.0 — 2016-03-30

## README

[![Build Status](https://travis-ci.org/mgduk/escape-quotes.svg?branch=master)](https://travis-ci.org/mgduk/escape-quotes)
[![GitHub issues](https://img.shields.io/github/issues/mgduk/escape-quotes.svg)](https://github.com/mgduk/escape-quotes/issues)

Adds a backslash before single quotes in a string (or whichever characters you like)

Examples
--------
```js
escape_quotes = require('escape-quotes');

escape_quotes("I'm a little teapot");
// => I\'m a little teapot

escape_quotes("No thanks, I already have a penguin", "a", "*");
// => No th*anks, I *alre*ady h*ave *a penguin
```

Usage
-----
```js
escape_quotes("String to escape chars in", "chars to escape" = "'", "escape char" = "\\")
```

Escape multiple characters by passing multiple characters in the second parameter


Tests
-----
```
npm test
```

Licence
-------
```
MIT License

Copyright (c) 2016 Matt Dolan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

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