Package Exports
- alex
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (alex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
📝 alex — Catch insensitive, inconsiderate writing.
Whether your own or someone else’s writing, alex helps you find gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing.
For example, when We’ve confirmed his identity is given to alex,
it will warn you and suggest using their instead of his.
Suggestions, feature requests, and issues are more than welcome!
Give alex a spin on the Online demo ».
Why
- To get better at considerate writing;
- Catches many possible offenses;
- Suggests helpful alternatives;
- Reads plain-text and markdown as input;
- Stylish.
Install
$ npm install alex --globalTable of Contents
Command Line

Let’s say example.md looks as follows:
The boogeyman wrote all changes to the **master server**. Thus, the slaves
were read-only copies of master. But not to worry, he was a cripple.Then, run alex on example.md:
$ alex example.mdYields:
example.md
1:5-1:14 warning `boogeyman` may be insensitive, use `boogey` instead
1:42-1:48 warning `master` / `slaves` may be insensitive, use `primary` / `replica` instead
2:52-2:54 warning `he` may be insensitive, use `they`, `it` instead
2:59-2:66 warning `cripple` may be insensitive, use `person with a limp` insteadSee $ alex --help for more information.
When no input files are given to alex, it searches for markdown and text files in the current directory,
doc, anddocs.
API
npm:
$ npm install alex --savealex is also available for bower and duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.
alex(value)
alex.markdown(value)
Example
alex('We’ve confirmed his identity.').messages;
/*
* [ { [1:17-1:20: `his` may be insensitive, use `their`, `theirs` instead]
* name: '1:17-1:20',
* file: '',
* reason: '`his` may be insensitive, use `their`, `theirs` instead',
* line: 1,
* column: 17,
* fatal: false } ]
*/Parameters
value(VFileorstring) — Markdown or plain-text.
Returns
VFile. You’ll probably be interested
in its messages property, as
demonstrated in the example above, as it holds the possible violations.
alex.text(value)
Works just like alex(), but does not parse as markdown
(thus things like code are not ignored)
Example
alex('The `boogeyman`.').messages; // []
alex.text('The `boogeyman`.').messages;
/*
* [ { [1:6-1:15: `boogeyman` may be insensitive, use `boogey` instead]
* name: '1:6-1:15',
* file: '',
* reason: '`boogeyman` may be insensitive, use `boogey` instead',
* line: 1,
* column: 6,
* fatal: false } ]
*/Integrations
- Atom — wooorm/atom-linter-alex
- Sublime — sindresorhus/SublimeLinter-contrib-alex
- Gulp — dustinspecker/gulp-alex
- Slack — keoghpe/alex-slack
Support
alex checks for many patterns of English language, and warns for:
Gendered work-titles, for example warning about
garbagemanand suggestinggarbage collectorinstead;Gendered proverbs, such as warning about
like a manand suggestingbravelyinstead, orladylikeand suggestingcourteous;Blunt phrases, such as warning about
crippleand suggestingperson with a limpinstead;Intolerant phrasing, such as warning about using
masterandslavetogether, and suggestingprimaryandreplicainstead.
alex ignores words meant literally, so “he”, He — ..., and the like
are not warned about
Workflow
The recommended workflow is to add alex locally and to run it with your tests.
A package.json file with npm scripts,
and additionally using AVA for unit tests, could look
as follows:
{
"scripts": {
"test-api": "ava",
"test-doc": "alex",
"test": "npm run test-api && npm run test-doc"
},
"devDependencies": {
"alex": "^1.0.0",
"ava": "^0.1.0"
}
}FAQ
Why is this named alex?
It’s a nice androgynous/unisex name, it was free on npm, I like it! 😄
Alex didn’t check ‘X’!
See CONTRIBUTING.md on how to get ‘X’ checked by alex.
Contributing
See CONTRIBUTING.md.