{"id":32264461,"url":"https://github.com/words/spache-formula","last_synced_at":"2026-02-19T21:02:39.062Z","repository":{"id":20765098,"uuid":"24049782","full_name":"words/spache-formula","owner":"words","description":"Formula to detect the grade level of text according to the (revised) Spache Readability Formula (1974)","archived":false,"fork":false,"pushed_at":"2022-11-01T15:11:16.000Z","size":55,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-05T13:54:56.234Z","etag":null,"topics":["ease","natural-language","readability","reading","spache"],"latest_commit_sha":null,"homepage":"https://wooorm.com/readability/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/words.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":"funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"wooorm"}},"created_at":"2014-09-15T09:03:15.000Z","updated_at":"2023-01-15T21:42:00.000Z","dependencies_parsed_at":"2022-08-25T23:13:31.903Z","dependency_job_id":null,"html_url":"https://github.com/words/spache-formula","commit_stats":null,"previous_names":["wooorm/spache-formula"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/words/spache-formula","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fspache-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fspache-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fspache-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fspache-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/words","download_url":"https://codeload.github.com/words/spache-formula/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fspache-formula/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29630637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ease","natural-language","readability","reading","spache"],"created_at":"2025-10-22T21:02:20.829Z","updated_at":"2026-02-19T21:02:39.048Z","avatar_url":"https://github.com/words.png","language":"JavaScript","funding_links":["https://github.com/sponsors/wooorm"],"categories":[],"sub_categories":[],"readme":"# spache-formula\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\nFormula to detect the grade level of text according to the [(revised) Spache\nreadability formula][formula].\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`spacheFormula(counts)`](#spacheformulacounts)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [Security](#security)\n*   [License](#license)\n\n## What is this?\n\nThis package exposes an algorithm to detect ease of reading of English texts.\n\n## When should I use this?\n\nYou’re probably dealing with natural language, and know you need this, if\nyou’re here!\n\nThis algorithm isn’t based on syllabbles compared to some other algorithms,\nwhich means it’s quicker to calculate.\n\nSee [`spache`][list] for a list of words which count as “known”.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][]:\n\n```sh\nnpm install spache-formula\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {spacheFormula} from 'https://esm.sh/spache-formula@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {spacheFormula} from 'https://esm.sh/spache-formula@2?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {spacheFormula} from 'spache-formula'\n\nspacheFormula({word: 30, sentence: 2, unfamiliarWord: 6}) // =\u003e 4.114\n\nspacheFormula({word: 30, sentence: 2}) // =\u003e 2.474\n\nspacheFormula() // =\u003e NaN\n```\n\n## API\n\nThis package exports the identifier `spacheFormula`.\nThere is no default export.\n\n### `spacheFormula(counts)`\n\nGiven the number of words (`word`), the number of sentences (`sentence`), and\nthe number of unique unfamiliar words (`unfamiliarWord`) in a document, returns\nthe grade level associated with the document.\n\n##### `counts`\n\nCounts from input document.\n\n###### `counts.sentence`\n\nNumber of sentences (`number`, required).\n\n###### `counts.word`\n\nNumber of words (`number`, required).\n\n###### `counts.unfamiliarWord`\n\nNumber of unfamiliar words (`number`, default: `0`).\n\n##### Returns\n\nGrade level associated with the document (`number`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type `Counts`.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Related\n\n*   [`automated-readability`](https://github.com/words/automated-readability)\n    — uses character count instead of error-prone syllable parser\n*   [`coleman-liau`](https://github.com/words/coleman-liau)\n    — uses letter count instead of an error-prone syllable parser\n*   [`dale-chall-formula`](https://github.com/words/dale-chall-formula)\n    — uses a dictionary, suited for higher reading levels\n*   [`flesch`](https://github.com/words/flesch)\n    — uses syllable count\n*   [`flesch-kincaid`](https://github.com/words/flesch-kincaid)\n    — like `flesch`, returns U.S. grade levels\n*   [`gunning-fog`](https://github.com/words/gunning-fog)\n    — uses syllable count, needs POS-tagging and NER\n*   [`smog-formula`](https://github.com/words/smog-formula)\n    — like `gunning-fog`, without the need for advanced NLP tasks\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## Security\n\nThis package is safe.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/words/spache-formula/workflows/main/badge.svg\n\n[build]: https://github.com/words/spache-formula/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/words/spache-formula.svg\n\n[coverage]: https://codecov.io/github/words/spache-formula\n\n[downloads-badge]: https://img.shields.io/npm/dm/spache-formula.svg\n\n[downloads]: https://www.npmjs.com/package/spache-formula\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/spache-formula.svg\n\n[size]: https://bundlephobia.com/result?p=spache-formula\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[formula]: https://en.wikipedia.org/wiki/Spache_Readability_Formula\n\n[list]: https://github.com/wooorm/spache\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwords%2Fspache-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwords%2Fspache-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwords%2Fspache-formula/lists"}