{"id":13438171,"url":"https://github.com/GitbookIO/rousseau","last_synced_at":"2025-03-19T18:32:12.810Z","repository":{"id":27768027,"uuid":"31256354","full_name":"GitbookIO/rousseau","owner":"GitbookIO","description":"Lightweight proofreader in JS","archived":false,"fork":false,"pushed_at":"2022-03-09T11:19:04.000Z","size":173,"stargazers_count":184,"open_issues_count":4,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-13T00:08:23.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitbookIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-24T11:06:04.000Z","updated_at":"2025-02-23T12:07:31.000Z","dependencies_parsed_at":"2022-07-13T07:40:50.071Z","dependency_job_id":null,"html_url":"https://github.com/GitbookIO/rousseau","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Frousseau","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Frousseau/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Frousseau/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Frousseau/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitbookIO","download_url":"https://codeload.github.com/GitbookIO/rousseau/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244483507,"owners_count":20460127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T03:01:03.409Z","updated_at":"2025-03-19T18:32:12.805Z","avatar_url":"https://github.com/GitbookIO.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Publishing and Sharing"],"sub_categories":["Writing"],"readme":"\n![Rousseau](./preview.jpg)\n\n[![Build Status](https://travis-ci.org/GitbookIO/rousseau.png?branch=master)](https://travis-ci.org/GitbookIO/rousseau)\n[![NPM version](https://badge.fury.io/js/rousseau.svg)](http://badge.fury.io/js/rousseau)\n\nRousseau is a lightweight proofreader written in Javascript, it can be used in Node.JS, in the command line and in the browser.\n\n### Installation\n\n```\n$ npm install rousseau\n```\n\n### API\n\n```js\nvar rousseau = require(\"rousseau\");\n\nrousseau('So the cat was stolen.', function(err, results) {\n    ...\n});\n```\n\n`results` is an array of object like:\n\n```js\n{\n    // Type of check that output this suggestion\n    type: \"so\",\n\n    // Level of importance\n    // \"suggestion\", \"warning\", \"error\"\n    level: \"warning\",\n\n    // Index in the text\n    index: 10,\n\n    // Size of the section in the text\n    offset: 2,\n\n    // Message to describe the suggestion\n    message: \"omit 'So' from the beginning of sentences\",\n\n    // Replacements suggestion\n    replacements: [\n        {\n            value: \"\"\n        }\n    ]\n}\n```\n\n### Checks\n\nYou can disable any combination of the following by providing a key with value `false` as option `checks` to `rousseau`.\n\n##### English\n\n| ID    | Description     |\n| ----- | --------------- |\n| `passive` | Checks for passive voice |\n| `lexical-illusion` | Checks for lexical illusions – cases where a word is repeated. |\n| `so` | Checks for `so` at the beginning of the sentence. |\n| `adverbs` | Checks for adverbs that can weaken meaning: really, very, extremely, etc. |\n| `readibility` | Checks for readibility of sentences. |\n| `simplicity` | Checks for simpler expressions |\n| `weasel` | Checks for \"weasel words.\" |\n| `sentence:start` | Checks that sentence is preceded by a space |\n| `sentence:end` | Checks that there is no space between a sentence and its ending punctuation |\n| `sentence:uppercase` | Checks that sentences are starting with uppercase letter |\n\n\n### Extend Rousseau\n\nExample: Extend rousseau with a Spellchecker.\n\n```js\nrousseau(\"Some text\", {\n    checks: {\n        spelling: rousseau.tokenize.check([\n            rousseau.tokenize.words(),\n            rousseau.filter(function(word) {\n                return wordIsValid(word);\n            }),\n            rousseau.define({\n                level: rousseau.levels.ERROR,\n                message: \"Spelling error\"\n            })\n        ])\n    }\n}, function(err, results) {\n    ...\n})\n\n```\n\n### Cache\n\nRousseau use an internal cache for certain operations (tokenization, spellchecking, ...); this cache can be configured using the option `cache`:\n\n```js\nrousseau('So the cat was stolen.', {\n    cache: 100 // A maximum of 100 elements will be stored in the memory cache\n}, function(err, results) {\n    ...\n});\n```\n\n### Contributing\n\nWe'd love to accept your patches and contributions to improve Rousseau (supported languages, checks, ...). Learn more about how to contribute in [CONTRIBUTING.md](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitbookIO%2Frousseau","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGitbookIO%2Frousseau","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitbookIO%2Frousseau/lists"}