Registry / devops / mongodb-ace-theme

mongodb-ace-theme

JSON →
library1.7.0jsnpmunverified

CSS highlighting styles for the ACE Editor tailored for MongoDB. Version 1.7.0 is the latest stable release, maintained as part of the MongoDB Compass project. Provides the visual theme for syntax-highlighting MongoDB queries and aggregation pipelines in ACE. Designed to be used with `mongodb-ace-mode` for language rules and `mongodb-ace-theme-query` for single-line input. Primarily used within MongoDB Compass and Charts, but can be used standalone.

npm install mongodb-ace-theme
INSTALL
IMPORT
SIG · MONGODB-ACE-THEME
M
mongodb-ace-theme
devopsjavascriptv1.7.0
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.

theme import
import 'mongodb-ace-theme'
import { mongodb } from 'mongodb-ace-theme'
The package is a CSS-only theme. Importing it registers the theme with ACE; no named exports.
theme usage
editor.setTheme("ace/theme/mongodb")
editor.setTheme("mongodb")
The theme string must include the 'ace/theme/' prefix as expected by ACE.
require (CommonJS)
require('mongodb-ace-theme')
const theme = require('mongodb-ace-theme')
CJS require works but returns nothing; do not assign to a variable.

Shows importing the theme and setting it on an ACE editor instance.

// Install: npm install mongodb-ace-theme // In your app: import 'mongodb-ace-theme'; const editor = ace.edit('editor'); editor.setTheme('ace/theme/mongodb'); editor.session.setMode('ace/mode/mongodb'); // requires mongodb-ace-mode
Debug
Known issues
gotchaThe import must occur before setTheme, otherwise ACE may not find the theme.
fix
Always import 'mongodb-ace-theme' at the top of your file before any ACE editor initialization.
affects: >=0.0.0
gotchaThis package only provides the theme CSS; it does not include MongoDB language syntax highlighting rules.
fix
Install and import 'mongodb-ace-mode' separately for syntax highlighting.
affects: >=0.0.0
gotchaIf using a bundler, ensure CSS/theme files are not excluded by your configuration (e.g., webpack's css-loader).
fix
Configure your bundler to handle CSS imports, e.g., add css-loader and style-loader to webpack.
affects: >=0.0.0
deprecatedThe package is maintained but not actively developed; it is part of the Compass ecosystem and may receive updates alongside Compass releases.
fix
Check for newer versions periodically; consider using ACE's built-in theme customization if more flexibility is needed.
affects: >=1.7.0
Errors
Common errors & fixes
editor.setTheme is not a function
Attempting to call setTheme before ACE editor is initialized or the editor variable is not an ACE instance.
fix
Ensure you have created an ACE editor with `ace.edit(element)` and that `editor` is the returned object.
Uncaught Error: Cannot find module 'mongodb-ace-theme'
The package is not installed or the import path is incorrect.
fix
Run `npm install mongodb-ace-theme` and verify the import statement is exactly `import 'mongodb-ace-theme'`.
Theme 'ace/theme/mongodb' not found
The import of the theme hasn't been executed before calling setTheme, or the theme string is misspelled.
fix
Place `import 'mongodb-ace-theme'` at the top of your entry file. Verify the theme string is exactly 'ace/theme/mongodb'.
Upgrade
Version history
1.7.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
mongodb-ace-theme — npm install mongodb-ace-theme · libregistry