npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

typopo

v2.5.8

Published

Fix frequent microtypography errors in multiple languages. Write neat texts without bothering about typography rules. Typopo works for English, German, Slovak, Czech and Rusyn language.

Downloads

5,470

Readme

Typopo logotype

Fix frequent microtypography errors in multiple languages. Write neat texts without bothering about typography rules. Typopo works for English, German, Slovak, Czech and Rusyn language.

GitHub package.json version GitHub Tests

Links

Contents

Features

Typopo fixes microtypography hiccups in five languages:

  • English
  • German
  • Czech
  • Slovak
  • Rusyn

Typopo fixes punctuation:

  • double quotes (and accidentally typed punctuation related to the use of double quotes)
  • double primes
  • single quotes (with an assumption they are used as secondary and in pairs)
  • single primes
  • apostrophes
  • hyphens & dashes
    • between words with a proper spacing per locale
    • between ordinal and cardinal numbers (e.g. 1–3 eggs)
    • within date (e.g. 2020–08–04)
    • between percentage range (e.g. 20–30 %)
  • period & ellipsis

Typopo fixes whitespace characters:

  • removes extra white spaces
    • at the beginning and the end of sentences (leading and trailing spaces)
    • between words and paragraphs
    • before or after punctuation (where applicable)
    • around an ellipsis and an aposiopesis (where applicable)
    • between a number sign (#) and a number
    • before ordinal indicators (e.g. 1 st → 1st)
  • removes empty lines
  • fixes non-breaking spaces
    • removes a nbsp between multi-letter words
    • replaces a space with a nbsp
      • after one-word prepositions
      • around “×”
      • after “&”
      • after cardinal numbers
      • after ordinal numbers
      • after ordinal Roman numerals
      • before single capital letters that are part of the phrase (e.g. Project X)
      • after name initials (e.g. Philip K. Dick)
      • after common single-word and multiple-word abbreviations
      • before % (percent), ‰ (per mille), ‱ (per myriad)

Typopo fixes words:

  • accidental uPPERCASE
  • the spelling of e.g., i.e., a.m. and p.m.
  • ISSN and ISBN formatting

Typopo fixes symbols:

  • multiplication sign (2 x 3 → 2 × 3)
  • section sign (§)
  • copyright ((c)2020 → © 2020)
  • sound recording copyright ((p)2020 → ℗ 2020)
  • registered trademark (Brand(r) → Brand®)
  • service mark (Brand(sm) → Brand℠)
  • trademark (Brand(tm) → Brand™)
  • plus-minus sign (+-, -+ → ±)
  • square and cube exponents (e.g. 100 µm² → 100 µm², 50 km³ → 50 km³)

Use

You can use Typopo as an online app, VS Code extension, NPM package or JavaScript library.

Online app

URL → https://typopo.org/

The online app is useful especially when you’re a book designer or a DTP operator. Before you typeset raw texts in a DTP app of your choice, run it through Typopo and fix microtypography with a single click.

Typopo—online app

VS Code extension

Typopo—VS Code extension

NPM package

Install Typopo as an NPM package in your web project:

npm install typopo

Import the package:

import { fixTypos } from 'typopo';

Check out an API on how to use the package.

JavaScript library

Download dist/typopo.min.js and include it in your web project or CMS. Check out an API on how to use the library.

API

Fix typos in given text (string) and locale; with an optional configuration:

fixTypos(string, locale, [configuration])

Locale options (supported languages):

  • "en-us" (English, default)
  • "rue" (Rusyn)
  • "sk" (Slovak)
  • "cs" (Czech)
  • "de-de" (German)

Optional configuration as a JavaScript object:

configuration = {
	// If true, removes empty lines between paragraphs
	removeLines : true, 
  
	// if true, removes empty lines before a nested Markdown list; 
	// set as false when you use Typopo to fix typography of your Markdown files
	// see examples: https://github.com/surfinzap/typopo/releases/tag/2%2F4%2F0
	removeWhitespacesBeforeMarkdownList : true, 

	// if true, markdown code blocks (i.e. `code`, ``code``, ```code```) will be ignored from being identified as incorrectly used single quote or double quote pairs
	// set as false when you want to fix typos in generic texts (non-Markdown files)
	// set as true when you want to keep Markdown code blocks in your Markdown files
	keepMarkdownCodeBlocks: false,
}

News & Releases

Check out the changelog for what has been released.

Subscribe to Typopo Newsletter to be the first to know about all the new features and improvements.

Support

If you love Typopo and you find it helpful, support the project via Patreon.

Your support will let me continue improving Typopo ecosystem—the app, NPM package and VS Code Extension.

Feedback

Have you found a bug? Do you have an idea for a feature request? You’re more than welcome to submit an issue here on GitHub.

If you prefer to email, drop me a line at [email protected].

License

Licensed under MIT license. (See LICENCE.TXT.)

Special thanks

  • @Viclick for adjusting the repo for modularisation (2.0.0)
  • @tomashruby for consultation on architecture (2.0.0)
  • @skurzinz for consultation & test on German typographic rules (2.2.0)
  • Filip Blažek for consultation on typography rules
  • @vit-svoboda for fixing the package to run in Node.js projects (2.3.1)