Emmet expands CSS-like abbreviations into HTML or stylesheet fragments for editors, Node, and browsers.
Overview
Emmet speeds HTML and CSS authoring by turning compact abbreviations into structured code. Syntax mirrors familiar CSS selectors with shortcuts for ids, classes, nesting, and attributes, expanded with a single keystroke in supported editors.
The core npm module parses and expands abbreviations at runtime, so snippets stay dynamic rather than fixed per project. It supports markup outputs for HTML, XML, HAML, Pug, JSX, and stylesheet outputs for CSS, SCSS, and SASS from dedicated abbreviation forms.
APIs include expanding a string, extracting abbreviations from source lines with look-ahead for auto-inserted brackets, optional prefix gating to avoid clashes in JSX, and configurable syntax profiles. Editor integrations live in separate repositories; this package holds the shared parser and expansion engine.
Emmet runs in JavaScript across web browsers, Node.js, and legacy hosts noted in project materials. Users can add custom snippets through JSON configuration in editor plugins.
Key features
- CSS-selector-like abbreviations
- Markup and stylesheet expansion
- Runtime dynamic snippets
- Multi-syntax output profiles
- Abbreviation extraction API
- Optional expansion prefix
- Custom snippet configuration
- npm core module
Use cases
- Rapid HTML boilerplate
- CSS property shorthand expansion
- Editor completion workflows
- JSX-friendly abbreviated markup
- Building editor tooling on Emmet