🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

codemirror-sfmc

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codemirror-sfmc

CodeMirror 6 extensions for Salesforce Marketing Cloud templates (HTML with AMPscript / SSJS): highlighting theme, completion wired to sfmc-language-lsp.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

codemirror-sfmc

CodeMirror 6 extensions for Salesforce Marketing Cloud HTML templates: embedded AMPscript and SSJS highlighting and autocompletion powered by sfmc-language-lsp.

Usage

Install CodeMirror 6 (@codemirror/state, @codemirror/view, and your preferred basic setup, e.g. the codemirror meta-package) then add:

import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { sfmcTemplateExtensions } from 'codemirror-sfmc';

const state = EditorState.create({
  doc: '<html>%%=Concat("a","b")=%%</html>',
  extensions: [
    /* your basic keymap / line numbers here */
    ...sfmcTemplateExtensions(),
  ],
});

new EditorView({ state, parent: document.body });

Language detection matches the VS Code extension: AMPscript markers (%%[, %%=, language="ampscript") take priority over <script runat="server"> for SSJS.

Exports

  • sfmcTemplateExtensions() — highlight plugin + theme + autocompletion.
  • sfmcTemplateHighlightPlugin, sfmcEditorTheme, sfmcAutocomplete() — compose your own stack.
  • codemirror-sfmc/detectdetectTemplateLanguage and helpers without pulling in @codemirror/* (for thin browser bundles).

License

MIT — see LICENSE.

Keywords

codemirror

FAQs

Package last updated on 09 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts