Always use curly quotes
npm install typographic-quotes[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coveralls Status][coveralls-image]][coveralls-url]
[![Dependency Status][depstat-image]][depstat-url]
> [Always use curly quotes][rtfm]
Micro module to help eliminate one of the [bad typewriter habits][habits].
``sh`
npm install --save typographic-quotes
Use typographic quotes for your text with respect to your locale, basically for
proper primary and secondary quotes. Pass object with specified locale field as
second parameter. locale field is mandatory. This module relies on
[typographic-quotes-l10n-db][quotesDB] in choosing proper quotes
for every language.
> In American English, double quotes are used normally (the “primary” style).
> If quote marks are used inside another pair of quote marks, then single quotes
> are used as the “secondary” style. For example: “Didn't she say ‘I like red
> best’ when asked her favorite wine?” he wondered to himself.
— from the Wikipedia
`js
var quotes = require('typographic-quotes');
// in american english (en-us) primary quotes are “”, and secondary are ‘’.
// in danish (da) primary quotes are »«, and secondary are ›‹.
// locale field is mandatoryfoo 'foo' bar
quotes(, { locale: 'en-us' }); // foo “foo” barfoo 'foo' bar
quotes(, { locale: 'da' }); // foo »foo« barfoo "foo 'inside' bar" bar
quotes(, { locale: 'en-us' }); // foo “foo ‘inside’ bar” barfoo 'foo "inside" bar' bar
quotes(, { locale: 'da' }); // foo »foo ›inside‹ bar« bar`
[quotesDB]: https://www.npmjs.com/package/typographic-quotes-l10n-db
If you want to see proper apostrophes too, take a look at [apostrophes][typographic-apostrophes] and [apostrophes-for-possessive-plurals][typographic-apostrophes-for-possessive-plurals] typographic modules. Use first one before this module, second after: apostrophes → quotes → apostrophes-for-possessive-plurals` (order is important). Check complex usage in [typography playground][playground].
[typographic-apostrophes]: https://www.npmjs.com/package/typographic-apostrophes
[typographic-apostrophes-for-possessive-plurals]: https://www.npmjs.com/package/typographic-apostrophes-for-possessive-plurals
[playground]: https://github.com/matmuchrapna/typographic-playground
MIT © Vladimir Starkov
[rtfm]: http://practicaltypography.com/straight-and-curly-quotes.html
[habits]: http://practicaltypography.com/typewriter-habits.html
[npm-url]: https://npmjs.org/package/typographic-quotes
[npm-image]: http://img.shields.io/npm/v/typographic-quotes.svg
[travis-url]: https://travis-ci.org/iamstarkov/typographic-quotes
[travis-image]: http://img.shields.io/travis/iamstarkov/typographic-quotes.svg
[coveralls-url]: https://coveralls.io/r/iamstarkov/typographic-quotes
[coveralls-image]: http://img.shields.io/coveralls/iamstarkov/typographic-quotes.svg
[depstat-url]: https://david-dm.org/iamstarkov/typographic-quotes
[depstat-image]: https://david-dm.org/iamstarkov/typographic-quotes.svg