Socket
Socket
Sign inDemoInstall

typographic-apostrophes

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    typographic-apostrophes

Make sure they’re curly and point downward


Version published
Maintainers
1
Install size
6.31 kB
Created

Readme

Source

typographic-apostrophes

NPM version Build Status Coveralls Status Dependency Status DevDependency Status

Make sure they’re curly and point downward

Micro module to help eliminate one of the bad typewriter habits.

Install

npm install --save typographic-apostrophes

Usage

Use typographic apostrophes in con­trac­tions and for pos­ses­sive case. This module don't cover posessive plurals, because it’s impossible to distinguish it from single closing quote.

That's why I created typographic-apostrophes-for-possessive-plurals, but it can be used safely only if there are zero closing quotes in the input; this can be achieved by typographic-quotes. That’s why for ideal result you should use all three modules in the chain: apostrophes → quotes → apostrophes-for-possessive-plurals (order is important).

var apostrophes = require('typographic-apostrophes');

apostrophes(`I'm looking forward`);        // I’m looking forward
apostrophes(`Don't do it!`);               // Don’t do it!
apostrophes(`as in the eagle's feathers`); // as in the eagle’s feathers
apostrophes(`in one month's time`);        // in one month’s time
apostrophes(`'60s and '80s`);              // ’60s and ’80s
apostrophes(`rock'n'roll`);                // rock’n’roll
apostrophes(`rock 'n' roll`);              // rock ’n’ roll

Real world examples

Check complex usage with real world examples in typography playground.

License

MIT © Vladimir Starkov

Keywords

FAQs

Last updated on 16 Apr 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc