Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reading-level

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reading-level

Convert text to a reading level based on the Flesch-Kincaid scoring system

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

reading-level

Reading-level returns the numeric reading level of a sample text based on the Flesch-Kincaid Grade Level Readability Formula.

const { readingLevel } = require('reading-level')

const text1 = 'this is a simple sentence'
const text2 = 'the perpendicular platypus perused the panoramic pyramid'
const text3 = '0120131908 74123987419823'
const text4 = ''

readingLevel(text1) // 3 
readingLevel(text2) // 21
readingLevel(text3) // 'Either no sentences or words, please enter valid text'
readingLevel(text4) // 'Either no sentences or words, please enter valid text'

readingLevel(text2, 'full') // { sentences: 1,
                            //   words: 7,
                            //   syllables: 20,
                            //   unrounded: 20.854285714285712,
                            //   rounded: 21 }

  • all numeric values and punctuation are stripped out before analysis
  • pass 'full' as a second argument to get the breakdown
  • this seems to work with languages besides english, however I have no idea about the accuracy of the results

test

npm run test

Keywords

FAQs

Package last updated on 21 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc