Documentation on bem-core is also available at bem.info. It is also available in Russian.
bem-core is a base library for web interface development.
It provides the minimal stack for coding client-side JavaScript and templating.
Install as an npm dependency:
npm install bem-core@5jQuery 4 is a peer dependency — install it alongside:
npm install jquery@^4.0.0common.blocks— suited for any devices and browsersdesktop.blocks— should be used for desktop browserstouch.blocks— implement some touch-platforms specifics
i-bem— base block with helpers for JS and HTMLstrings— helpers for JS-stringsobjects— helpers for JS-objectsfunctions— helpers for JS-functionsevents— JS-eventsuri— helpers for work with URIs and querystringstick— global timeridle— IDLE eventnext-tick— polyfill fornextTick/setTimeout(0, ...)inherit— OOP helpersjquery— jQueryclearfix— CSS clearfix trickidentify— identify JS-objectscookie— helpers for work with browser cookiesdom— helpers for work with DOMloader— loader for JS filesua— browser features detectionkeyboard— keyboard helperspage— html/head/body scaffold
- vanilla.js + browser.js
- bemhtml
- bemtree
The autogenerated JSDoc API can be found on bem.info. E.g. JSDoc for i-bem is here https://en.bem.info/platform/libs/bem-core/current/desktop/i-bem/#jsdoc
See CHANGELOG.md.
If you are upgrading from v4, see MIGRATION.md.
-
Get the source code:
git clone -b v5 git://github.com/bem/bem-core.git cd bem-core -
Install the dependencies (requires Node.js 20+):
npm install
-
Run linting:
npm run lint
-
Run tests:
npm test # server-side tests (node:test) npm run test:browser # browser tests (Playwright) npm run test:all # both
-
Build:
npm run build # desktop + touch platforms
Please refer to How to contribute guide.
- Google Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Code and documentation copyright 2012 YANDEX LLC. Code released under the Mozilla Public License 2.0.