# quotation

> Quote a value

Latest version **2.0.3** (published 2023-12-15) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2023-12-15 |
| First published | 2016-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Titus Wormer |
| Maintainers | wooorm |
| Keywords | double, single, quote, quotation, dumb, smart, single, double, low, high, guillemet |

## Links

- npm: https://www.npmjs.com/package/quotation
- Repository: https://github.com/wooorm/quotation
- Homepage: https://github.com/wooorm/quotation#readme
- Issues: https://github.com/wooorm/quotation/issues
- Funding: https://github.com/sponsors/wooorm
- npm.io page: https://npm.io/package/quotation

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 2.0.3 (latest) — 2023-12-15
- 2.0.2 — 2021-11-05
- 2.0.1 — 2021-03-12
- 2.0.0 — 2021-03-12
- 1.1.3 — 2020-01-25
- 1.1.2 — 2019-05-11
- 1.1.1 — 2018-04-28
- 1.1.0 — 2016-11-19
- 1.0.1 — 2016-01-14
- 1.0.0 — 2016-01-14

## README

# quotation

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Quote a value.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`quotation(value[, open[, close]])`](#quotationvalue-open-close)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package makes it quite easy to quote one or more values.

## When should I use this?

Use this package if you need to quote one or more strings with straight or smart
quotes.

## Install

This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:

```sh
npm install quotation
```

In Deno with [`esm.sh`][esmsh]:

```js
import {quotation} from 'https://esm.sh/quotation@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {quotation} from 'https://esm.sh/quotation@2?bundle'
</script>
```

## Use

```js
import {quotation} from 'quotation'

quotation('one') // => '"one"'
quotation(['one', 'two']) // => ['"one"', '"two"']
quotation('one', "'") // => "'one'"
quotation('one', '“', '”') // => '“one”'
```

## API

This package exports the identifier `quotation`.
There is no default export.

### `quotation(value[, open[, close]])`

Quote a value.

###### Parameters

*   `value` (`string` or `string[]`)
    — value to wrap in quotes
*   `open` (`string`, default: `"`)
    — character to add at start of `value`
*   `close` (`string`, default: `open` or `"`)
    — character to add at end of `value`

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/quotation/workflows/main/badge.svg

[build]: https://github.com/wooorm/quotation/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/quotation.svg

[coverage]: https://codecov.io/github/wooorm/quotation

[downloads-badge]: https://img.shields.io/npm/dm/quotation.svg

[downloads]: https://www.npmjs.com/package/quotation

[size-badge]: https://img.shields.io/bundlephobia/minzip/quotation.svg

[size]: https://bundlephobia.com/result?p=quotation

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

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