{"id":32259103,"url":"https://github.com/words/smog-formula","last_synced_at":"2026-03-17T16:04:31.656Z","repository":{"id":20765094,"uuid":"24049778","full_name":"words/smog-formula","owner":"words","description":"Formula to detect the ease of reading a text according to the SMOG (Simple Measure of Gobbledygook) formula (1969)","archived":false,"fork":false,"pushed_at":"2022-11-01T14:52:40.000Z","size":54,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-30T20:38:37.889Z","etag":null,"topics":["ease","gobbledygook","readability","reading","smog"],"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:02:58.000Z","updated_at":"2025-02-17T07:31:28.000Z","dependencies_parsed_at":"2022-08-26T01:50:32.661Z","dependency_job_id":null,"html_url":"https://github.com/words/smog-formula","commit_stats":null,"previous_names":["wooorm/smog-formula"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/words/smog-formula","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fsmog-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fsmog-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fsmog-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fsmog-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/words","download_url":"https://codeload.github.com/words/smog-formula/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Fsmog-formula/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30626906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T14:16:03.965Z","status":"ssl_error","status_checked_at":"2026-03-17T14:16:03.380Z","response_time":56,"last_error":"SSL_read: 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","gobbledygook","readability","reading","smog"],"created_at":"2025-10-22T19:57:53.916Z","updated_at":"2026-03-17T16:04:31.650Z","avatar_url":"https://github.com/words.png","language":"JavaScript","readme":"# smog-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 [SMOG (simple measure\nof gobbledygook) 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    *   [`smogFormula(counts)`](#smogformulacounts)\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 is based on syllables, whereas some others are not, which means\nit’s tougher to get right and slower to calculate.\n\nSee [`syllable`][syllable] for detecting syllables.\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 smog-formula\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {smogFormula} from 'https://esm.sh/smog-formula@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {smogFormula} from 'https://esm.sh/smog-formula@2?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {smogFormula} from 'smog-formula'\n\n// For “The Australian platypus is seemingly a hybrid of a mammal and reptilian\n// creature.” (1 sentence; 4 polysillabic words).\nsmogFormula({sentence: 1, polysillabicWord: 4})\n// =\u003e 14.554593…\n```\n\n## API\n\nThis package exports the identifier `smogFormula`.\nThere is no default export.\n\n### `smogFormula(counts)`\n\nGiven an object containing the number of sentences (`sentence`) and the number\nof polysillabic (three or more syllables) words (`polysillabicWord`) in a\ndocument, returns the reading ease 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.polysillabicWord`\n\nNumber of polysillabic (three or more syllables) words (`number`, required).\n\n##### Returns\n\nReading ease 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*   [`spache-formula`](https://github.com/words/spache-formula)\n    — uses a dictionary, suited for lower reading levels\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/smog-formula/workflows/main/badge.svg\n\n[build]: https://github.com/words/smog-formula/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/words/smog-formula.svg\n\n[coverage]: https://codecov.io/github/words/smog-formula\n\n[downloads-badge]: https://img.shields.io/npm/dm/smog-formula.svg\n\n[downloads]: https://www.npmjs.com/package/smog-formula\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/smog-formula.svg\n\n[size]: https://bundlephobia.com/result?p=smog-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/SMOG\n\n[syllable]: https://github.com/words/syllable\n","funding_links":["https://github.com/sponsors/wooorm"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwords%2Fsmog-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwords%2Fsmog-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwords%2Fsmog-formula/lists"}