@beanbag/codemirror-speak-and-spell

中文文档
1.0.1发布于 2025/06/27MITESM + CJS零依赖近 30 天下载 1869

Browser-native spell checking, AI writing, and more in CodeMirror v5

原始使用文档
文档目录4 节
  1. Installation and Usage
  2. License
  3. Important Notes
  4. Our Other Projects

CodeMirror Speak-and-Spell

This is a plugin for CodeMirror v5 that provides more reliable support for:

  • The browser's built-in spell checker
  • Speech-to-text input
  • Platform or browser-provided AI-assisted writing
  • Text transformations

It works in cooperation with CodeMirror v5's inputStyle: 'contenteditable' and spellcheck: true settings, and avoids many of the quirks that could sometimes appear.

It does this by intercepting the browser's attempts at performing these text changes, blocking them and re-attempting them directly using CodeMirror's API. This keeps CodeMirror and the browser from fighting with each other any time text is being inserted or replaced by the browser.

Installation and Usage

There are two ways you can use this plugin:

  1. Simply download the latest script from our releases or our repository's build/ directory and embed it in your page.

    For example:

    <script src="/js/beanbag-codemirror-speak-and-spell-cm5-1.0.0.min.js"></script>
    
  2. Alternatively, install using npm:

    $ npm install --save @beanbag/codemirror-speak-and-spell
    

    And then import into another module:

    import { SpeakAndSpell } from '@beanbag/codemirror-speak-and-spell/cm5';
    

Once installed and running in your CodeMirror v5 environment, simply activate it:

const codeMirror = new CodeMirror(element, {
    inputStyle: 'contenteditable',
    spellcheck: true,
    speakAndSpell: true,
});

License

CodeMirror Speak-and-Spell is available under the MIT license.

Important Notes

Not all browsers implement spell checking the same way.

Firefox will check the text in your CodeMirror immediately when rendered, but Chrome and Safari usually won't. Instead, they'll check when typing or when interacting with a word.

This means that you won't always see misspelled words on Chrome or Safari immediately, but this is browser behavior and not something that can be worked around. It's also not specific to CodeMirror.

To ensure the best experience, you'll want the latest evergreen versions of Firefox and Chrome, and the latest OS releases of Safari.

Our Other Projects

  • Review Board - Our open source, extensible code review, document review, and image review tool.

  • Djblets - Our pack of Django utilities for datagrids, API, extensions, and more. Used by Review Board.

  • Spina - A modern Backbone-like class library, built with TypeScript and extensibility in mind.

  • Ink - The accessible, themeable UI component library powering Review Board.

  • Housekeeping - Deprecation management for Python modules, classes, functions, and attributes.

  • kgb - A powerful function spy implementation to help write Python unit tests.

  • Typelets - Type hints and utility objects for Python and Django projects.

You can see more on github.com/beanbaginc and github.com/reviewboard.

版本与发布记录

@beanbag/codemirror-speak-and-spell 共发布 2 个版本,首次发布于 2025/06/27;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.1latest2025/06/271.4 年前
1.0.02025/06/271.4 年前

关于 @beanbag/codemirror-speak-and-spell 的常见问题

@beanbag/codemirror-speak-and-spell 是什么?

Browser-native spell checking, AI writing, and more in CodeMirror v5

如何安装 @beanbag/codemirror-speak-and-spell?

在项目目录运行 npm install @beanbag/codemirror-speak-and-spell,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:codemirror(^5)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@beanbag/codemirror-speak-and-spell 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/beanbag__codemirror-speak-and-spell 是否存在。

@beanbag/codemirror-speak-and-spell 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@beanbag/codemirror-speak-and-spell 可以商用吗?

@beanbag/codemirror-speak-and-spell 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@beanbag/codemirror-speak-and-spell 的下载量有多少?

根据 npm 官方下载统计,@beanbag/codemirror-speak-and-spell 在 2026/10/08 – 2026/11/06 这 30 天内被下载 1,869 次,日均约 62 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@beanbag/codemirror-speak-and-spell 还在维护吗?

最新版本 1.0.1 发布于 2025/06/27(1.4 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/06/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。