1.0.0 • Published 6 years ago

horunge v1.0.0

Weekly downloads
8
License
-
Repository
github
Last release
6 years ago

Horunge.js Build Status

Easily prevent typographic orphans.

npm.io

Horunge is the Swedish equivalent for orphans when we’re talking typography. Supports CommonJS, AMD or browser globals.

Install

NPM

npm install horunge

Manual install

Download the production version or the development version.

Usage

Browser globals

<h1>This is a sample heading</h1>

<script src="horunge.min.js"></script>
<script>
  const headlines = document.querySelectorAll("h1")
  headlines.forEach(function(headline) {
    headline.innerHTML = horunge(headline.innerHTML)
  });
</script>

CommonJS

import horunge from 'horunge';

const heading = 'This is a sample heading';
const fixedHeading = horunge(heading);

Api

horunge(string, [opt = 2]);

ParamDescription
stringString to fix
optNumber of words to keep at same row (optional) (default: 2)

List of releases List of contributors