spache-formula
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    spache-formula

    Build Coverage Downloads Size

    Formula to detect the grade level of text according to the (revised) Spache readability formula.

    See spache for a list of words which count as “known”.

    Install

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

    npm:

    npm install spache-formula

    Use

    import {spacheFormula} from 'spache-formula'
    
    spacheFormula({word: 30, sentence: 2, unfamiliarWord: 6}) // => 4.114
    
    spacheFormula({word: 30, sentence: 2}) // => 2.474
    
    spacheFormula() // => NaN

    API

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

    spacheFormula(counts)

    Given the number of words (word), the number of sentences (sentence), and the number of unique unfamiliar words (unfamiliarWord) in a document, returns the grade level associated with the document.

    Related

    License

    MIT © Titus Wormer

    Install

    npm i spache-formula

    DownloadsWeekly Downloads

    1,086

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    6.96 kB

    Total Files

    5

    Last publish

    Collaborators

    • wooorm
    • zeke