You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{smogFormula}from'smog-formula'// For “The Australian platypus is seemingly a hybrid of a mammal and reptilian// creature.” (1 sentence; 4 polysillabic words).smogFormula({sentence: 1,polysillabicWord: 4})// => 14.554593…
API
This package exports the identifier smogFormula.
There is no default export.
smogFormula(counts)
Given an object containing the number of sentences (sentence) and the number
of polysillabic (three or more syllables) words (polysillabicWord) in a
document, returns the reading ease associated with the document.
counts
Counts from input document.
counts.sentence
Number of sentences (number, required).
counts.polysillabicWord
Number of polysillabic (three or more syllables) words (number, required).
Returns
Reading ease associated with the document (number).
Types
This package is fully typed with TypeScript.
It exports the additional type Counts.
Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.