UNPKG

1.46 kBMarkdownView Raw
1# quotation
2
3[![Build][build-badge]][build]
4[![Coverage][coverage-badge]][coverage]
5[![Downloads][downloads-badge]][downloads]
6[![Size][size-badge]][size]
7
8Quote a value.
9
10## Installation
11
12[npm][]:
13
14```bash
15npm install quotation
16```
17
18## Usage
19
20```js
21var quotation = require('quotation')
22
23quotation('one') // => '"one"'
24quotation(['one', 'two']) // => ['"one"', '"two"']
25quotation('one', "'") // => '\'one\''
26quotation('one', '“', '”') // => '“one”'
27```
28
29## API
30
31### `quotation(value[, open[, close]])`
32
33Quote a value.
34
35###### Parameters
36
37* `value` (`string` or `Array.<string>`)
38 — Value to wrap in quotes
39* `open` (`string`, default: `"`)
40 — Character to add at start of `value`
41* `close` (`string`, default: `open` or `"`)
42 — Character to add at end of `value`
43
44## License
45
46[MIT][license] © [Titus Wormer][author]
47
48<!-- Definitions -->
49
50[build-badge]: https://img.shields.io/travis/wooorm/quotation.svg
51
52[build]: https://travis-ci.org/wooorm/quotation
53
54[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/quotation.svg
55
56[coverage]: https://codecov.io/github/wooorm/quotation
57
58[downloads-badge]: https://img.shields.io/npm/dm/quotation.svg
59
60[downloads]: https://www.npmjs.com/package/quotation
61
62[size-badge]: https://img.shields.io/bundlephobia/minzip/quotation.svg
63
64[size]: https://bundlephobia.com/result?p=quotation
65
66[npm]: https://docs.npmjs.com/cli/install
67
68[license]: license
69
70[author]: https://wooorm.com