Registry / productivity / nib-schema

nib-schema

JSON →
library2.4.7jsnpmunverified

Schema declarations for the Nib editor, a ProseMirror-based WYSIWYG editor. Current stable version is 2.4.7. Provides predefined nodes (paragraph, heading, list, image, code block, hard break, text) and marks (strong, em, link, code) used by Nib editor. Part of a modular ecosystem with separate core and schema packages. Lightweight and focused, unlike larger schema definitions like ProseMirror's example-schema. Released on npm and updated as Nib evolves.

npm install nib-schema
INSTALL
IMPORT
SIG · NIB-SCHEMA
N
nib-schema
productivityjavascriptv2.4.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

schema
import { schema } from 'nib-schema'
const schema = require('nib-schema').schema
Package uses ESM; CommonJS require should include .default or .schema.
nodes
import { nodes } from 'nib-schema'
import { schemaNodes } from 'nib-schema'
Export name is 'nodes', not 'schemaNodes'.
marks
import { marks } from 'nib-schema'
Named export; no common mistake with this symbol.

Shows how to import the schema, access nodes and marks, and initialize a ProseMirror editor with it.

import { schema } from 'nib-schema'; // Access node types const paragraph = schema.nodes.paragraph; const heading = schema.nodes.heading; // Access mark types const strong = schema.marks.strong; const link = schema.marks.link; // Use schema to create a ProseMirror document import { EditorState } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; const state = EditorState.create({ schema }); new EditorView(document.getElementById('editor'), { state });
Debug
Known issues
gotchaThe package does not include all required ProseMirror dependencies; you must install prosemirror-model, prosemirror-state, and prosemirror-view separately.
fix
Install peer dependencies explicitly: npm install prosemirror-model prosemirror-state prosemirror-view
affects: >=0.0.0
gotchaExport is named, not default; using default import results in undefined.
fix
Use named import: import { schema } from 'nib-schema'
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'prosemirror-model'
missing peer dependency prosemirror-model
fix
npm install prosemirror-model
TypeError: Cannot read properties of undefined (reading 'nodes')
Default import instead of named import; default export is undefined in ESM context
fix
Change to named import: import { schema } from 'nib-schema'
Upgrade
Version history
2.4.7latest on npm
Audit
Dependencies
prosemirror-modelrequiredRequired to define and use ProseMirror schema objects.
prosemirror-schema-listrequiredProvides list node specs (orderedList, bulletList, listItem).
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
nib-schema — npm install nib-schema · libregistry