gunning-fog

Formula to detect the ease of reading a text according to the Gunning fog index (1952)

Usage no npm install needed!

<script type="module">
  import gunningFog from 'https://cdn.skypack.dev/gunning-fog';
</script>

README

gunning-fog

Build Coverage Downloads Size

Formula to detect the grade level of text according to the gunning fog index.

See syllable for detecting syllables.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install gunning-fog

Use

import {gunningFog} from 'gunning-fog'

// For “The Australian platypus is seemingly a hybrid of a mammal and reptilian
// creature.”
// 1 sentence; 13 words; 4 polysillabic words, of which two are jargon, proper
// nouns, or compound words.
gunningFog({sentence: 1, word: 13, complexPolysillabicWord: 2})
// => 11.353846...

API

This package exports the following identifiers: gunningFog. There is no default export.

gunningFog(counts)

Given an object containing the number of words (word), the number of sentences (sentence), and the number of complex (excluding jargon, proper nouns, compound words) polysillabic (three or more syllables) words (complexPolysillabicWord) in a document, returns the grade level associated with the document.

Related

License

MIT © Titus Wormer