Registry / web-framework / tiptap-utils

tiptap-utils

JSON →
library1.13.1jsnpmunverified

tiptap-utils is an older, standalone JavaScript package providing a collection of general utility functions designed for the Tiptap editor. Its current stable version is 1.13.1, with its last release approximately five years ago. This package is distinct from the modern `@tiptap/core` (v2/v3) monorepo and its associated extensions, which now integrate many of the functionalities previously offered by `tiptap-utils` directly into the core library or specific extensions. As such, `tiptap-utils` does not adhere to the active and rapid release cadence of the current Tiptap ecosystem. Developers are generally advised to use the utilities provided by `@tiptap/core` for modern Tiptap implementations, as `tiptap-utils` may have compatibility issues with newer editor versions due to significant API changes.

npm install tiptap-utils
INSTALL
IMPORT
SIG · TIPTAP-UTILS
T
tiptap-utils
web-frameworkjavascriptv1.13.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

getMarkAttrs
import { getMarkAttrs } from 'tiptap-utils'
const { getMarkAttrs } = require('tiptap-utils')
While CommonJS `require` might work in some older Node environments, `tiptap-utils` is primarily designed for browser usage and ES module imports are standard. Note that modern Tiptap (@tiptap/core v2/v3) handles mark attributes differently, often directly on the editor state.
markIsActive
import { markIsActive } from 'tiptap-utils'
import markIsActive from 'tiptap-utils'
This package uses named exports for its utility functions. Attempting a default import will result in `undefined`. Modern Tiptap offers equivalent functionality via `editor.isActive()` methods.
nodeIsActive
import { nodeIsActive } from 'tiptap-utils'
require('tiptap-utils').nodeIsActive
For `tiptap-utils` (v1.x), prefer explicit named imports. Modern Tiptap (@tiptap/core v2/v3) provides `editor.isActive('nodeName')` for checking node activity.

Demonstrates importing and using `markIsActive` and `nodeIsActive` with an older Tiptap v1.x Editor instance to check the active state of marks and nodes.

import { Editor } from 'tiptap'; import { markIsActive, nodeIsActive } from 'tiptap-utils'; import { Bold, Paragraph, Document } from 'tiptap-extensions'; // Example extensions for older Tiptap // This example is for older Tiptap v1.x, which `tiptap-utils` was designed for. // It is NOT compatible with @tiptap/core v2/v3. const editor = new Editor({ extensions: [ new Document(), new Paragraph(), new Bold(), ], content: '<p>This is <strong>bold</strong> text.</p>', onUpdate: ({ editor }) => { const state = editor.state; console.log('Is bold mark active?', markIsActive(state, 'bold')); console.log('Is paragraph node active?', nodeIsActive(state, 'paragraph')); }, }); // To simulate usage in a non-interactive environment or test: setTimeout(() => { const state = editor.state; console.log('Is bold mark active after timeout?', markIsActive(state, 'bold')); console.log('Is paragraph node active after timeout?', nodeIsActive(state, 'paragraph')); editor.destroy(); }, 1000);
Debug
Known issues
breakingThe `tiptap-utils` package (v1.x) is designed for the original Tiptap v1.x editor. It is generally not compatible with `@tiptap/core` v2 or v3 due to fundamental changes in the editor's architecture, state management, and API surface. Attempting to use `tiptap-utils` with modern Tiptap will likely lead to runtime errors or incorrect behavior.
fix
For `@tiptap/core` v2/v3, use the built-in utility functions and methods provided by the `Editor` instance or the `@tiptap/core` package itself (e.g., `editor.isActive()`, `editor.getAttributes()`, `editor.chain().focus()`). Consult the official Tiptap v2/v3 documentation for current best practices.
affects: all
deprecatedThis package has not received updates in approximately five years. Many of its functionalities have been superseded or integrated directly into the core `@tiptap/core` package and its extensions. Continuing to use `tiptap-utils` in new projects is strongly discouraged.
fix
Migrate to the equivalent functionalities offered by `@tiptap/core` (v2/v3) or relevant `@tiptap/*` extensions. This might require refactoring parts of your editor logic.
affects: all
gotchaThe package metadata provided in the prompt (recent releases) pertains to the *modern* `@tiptap` monorepo (v3.x) and not to the `tiptap-utils` package (v1.x) itself. Do not confuse `tiptap-utils`'s versioning and release history with the active development of `@tiptap/core`.
fix
Always verify the specific package you are intending to use. If targeting `@tiptap/core` v2/v3, rely solely on the official documentation and packages prefixed with `@tiptap/`.
affects: all
Errors
Common errors & fixes
TypeError: editor.state is undefined
Attempting to pass a modern Tiptap v2/v3 `editor` instance or its internal state to a `tiptap-utils` function, which expects the structure of Tiptap v1.x.
fix
Ensure you are using `tiptap-utils` with a Tiptap v1.x editor. If using Tiptap v2/v3, use the built-in `editor.state` property and the `editor.isActive()` method directly on the editor instance instead of `tiptap-utils` functions.
Error: Cannot find module 'tiptap-utils' or SyntaxError: Named export 'markIsActive' not found.
Incorrect import statement (e.g., using `require` in an ESM project, or bundling issues) or attempting to access a non-existent export.
fix
Verify that `tiptap-utils` is installed correctly (`npm install tiptap-utils`). For ESM projects, use `import { markIsActive } from 'tiptap-utils';`. Ensure your bundler is configured to handle older CommonJS or UMD packages if necessary, though it's recommended to avoid this package entirely for modern projects.
Upgrade
Version history
1.13.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources
tiptap-utils — npm install tiptap-utils · libregistry