{"id":13772394,"url":"https://github.com/maxpoletaev/node-beml","last_synced_at":"2026-03-16T20:33:34.660Z","repository":{"id":74758874,"uuid":"16047402","full_name":"maxpoletaev/node-beml","owner":"maxpoletaev","description":"HTML preprocessor for BEM","archived":false,"fork":false,"pushed_at":"2019-03-19T09:37:29.000Z","size":37,"stargazers_count":64,"open_issues_count":2,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-05-18T20:25:02.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxpoletaev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-01-19T14:28:12.000Z","updated_at":"2024-01-30T11:26:50.000Z","dependencies_parsed_at":"2024-01-15T04:12:38.440Z","dependency_job_id":null,"html_url":"https://github.com/maxpoletaev/node-beml","commit_stats":null,"previous_names":["zenwalker/node-beml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpoletaev%2Fnode-beml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpoletaev%2Fnode-beml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpoletaev%2Fnode-beml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpoletaev%2Fnode-beml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxpoletaev","download_url":"https://codeload.github.com/maxpoletaev/node-beml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244105703,"owners_count":20398905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:03.487Z","updated_at":"2026-03-16T20:33:34.633Z","avatar_url":"https://github.com/maxpoletaev.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":["Template engines"],"readme":"# BEML [![Build Status][build]][build-link]\n\n[build]: https://travis-ci.org/zenwalker/node-beml.png?branch=master\n[build-link]: https://travis-ci.org/zenwalker/node-beml\n\nThis is simple HTML preprocessor (or postprocessor) which extend HTML syntax for\ncomfortable working with bem html.\n\nAlso available plugins for [Gulp](https://github.com/zenwalker/gulp-beml),\n[Grunt](https://github.com/zenwalker/grunt-beml), [Broccoli](https://github.com/Inzephirum/broccoli-beml) and [Postxml](https://github.com/postxml/postxml-beml).\n\n## Why?\n\nRaw HTML in BEM style is difficult to read. Also, I (and not only I) love HTML\nand don't want to use BEMHTML, BEMJSON and others specific technologies.\n\n## Targets\n\n* Maximum simplicity - HTML syntax, without translate from another language.\n* Possibility port to other languages (e.g. PHP or Python).\n* Joint work with template engines.\n* Ease of use.\n\n## Sample\n\n```html\n\u003cdiv block=\"b-animals\"\u003e\n  \u003cdiv elem=\"cat\" mod=\"size:big, color:red\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\ntranslated to\n\n```html\n\u003cdiv class=\"b-animals\"\u003e\n  \u003cdiv class=\"b-animals__cat b-animals__cat_size_big b-animals__cat_color_red\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n## How to use\n\n```javascript\nvar beml = require('beml');\n\nvar config = {\n  elemPrefix: '__',\n  modPrefix: '_',\n  modDlmtr: '_'\n};\n\nvar html = beml('\u003cdiv block=\"b-block\" mod=\"size:big\"\u003e\u003c/div\u003e', config);\nconsole.log(html);\n```\n\n## Syntax reference\n\n### Blocks\n\n```html\n\u003cdiv block=\"animals\"\u003e\n  \u003cdiv block=\"unicorn\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```html\n\u003cdiv class=\"animals\"\u003e\n  \u003cdiv class=\"unicorn\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n### Elements\n\n```html\n\u003cdiv block=\"animals\"\u003e\n  \u003cdiv elem=\"item\"\u003e\n    \u003cdiv elem=\"item-name\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n```html\n\u003cdiv class=\"animals\"\u003e\n  \u003cdiv class=\"animals__item\"\u003e\n    \u003cdiv class=\"animals__item-name\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n### Modifiers\n\n```html\n\u003cdiv block=\"animals\"\u003e\n  \u003cdiv block=\"unicorn\" mod=\"size:large, female\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n```html\n\u003cdiv class=\"animals\"\u003e\n  \u003cdiv class=\"unicorn inicorn_size_large unicorn_female\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n### Mixes\n\n```html\n\u003cdiv block=\"animals\"\u003e\n  \u003cdiv elem=\"item\" mix=\"block:unicorn, mod: [large, female]\"\u003e\n    \u003cdiv block=\"unicorn\" elem=\"photo\"\u003e\u003c/div\u003e\n    \u003cdiv elem=\"item-name\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n```html\n\u003cdiv class=\"animals\"\u003e\n  \u003cdiv class=\"animals__item unicorn unicorn_large unicorn_female\"\u003e\n    \u003cdiv class=\"unicorn__photo\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"animals__item-name\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\nFor complex values you can use pseudo JSON syntax:\n\n```html\n\u003cdiv block=\"unicorn\" mix=\"block:animals, elem:item, mod:{size:large,gender:female}\"\u003e\u003c/div\u003e\n\u003cdiv block=\"unicorn\" mix=\"{block:b-mix-1}, {block:b-mix-2, mod:[mod1, mod2]}\"\u003e\u003c/div\u003e\n```\n\n```html\n\u003cdiv class=\"unicorn animals__item animals__item_size_large animals__item_gender_female\"\u003e\u003c/div\u003e\n\u003cdiv class=\"unicorn b-mix-1 b-mix-2 b-mix-2_mod1 b-mix-2_mod_2\"\u003e\u003c/div\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpoletaev%2Fnode-beml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxpoletaev%2Fnode-beml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpoletaev%2Fnode-beml/lists"}