{"id":18264854,"url":"https://github.com/bem/bem-core","last_synced_at":"2025-04-13T00:48:28.414Z","repository":{"id":6851472,"uuid":"8100172","full_name":"bem/bem-core","owner":"bem","description":"BEM Core Library","archived":false,"fork":false,"pushed_at":"2020-09-04T00:50:47.000Z","size":4470,"stargazers_count":276,"open_issues_count":95,"forks_count":95,"subscribers_count":52,"default_branch":"v4","last_synced_at":"2025-04-13T00:48:20.294Z","etag":null,"topics":["bem","components","framework","frontend","javascript"],"latest_commit_sha":null,"homepage":"https://ru.bem.info/technologies/classic/i-bem/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bem.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-08T19:53:17.000Z","updated_at":"2025-01-20T08:06:45.000Z","dependencies_parsed_at":"2022-08-26T09:22:25.925Z","dependency_job_id":null,"html_url":"https://github.com/bem/bem-core","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fbem-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fbem-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fbem-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bem%2Fbem-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bem","download_url":"https://codeload.github.com/bem/bem-core/tar.gz/refs/heads/v4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650437,"owners_count":21139672,"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":["bem","components","framework","frontend","javascript"],"created_at":"2024-11-05T11:16:19.767Z","updated_at":"2025-04-13T00:48:28.391Z","avatar_url":"https://github.com/bem.png","language":"JavaScript","readme":"# bem-core library [![Build Status](https://travis-ci.org/bem/bem-core.svg?branch=v2)](https://travis-ci.org/bem/bem-core) [![GitHub Release](https://img.shields.io/github/release/bem/bem-core.svg)](https://github.com/bem/bem-core/releases) [![devDependency Status](https://david-dm.org/bem/bem-core/dev-status.svg)](https://david-dm.org/bem/bem-core#info=devDependencies)\n\nDocumentation on `bem-core` in a much more informative way is also available at [bem.info](https://en.bem.info/libs/bem-core/). It is also available [in Russian](https://ru.bem.info/libs/bem-core/).\n\n## What is this?\n\n`bem-core` is a base library for web interface development.\nIt provides the minimal stack for coding client-side JavaScript and templating.\n\n## Use\n\nThe easiest way to run a project with `bem-core` is to use\nthe [project-stub](https://github.com/bem/project-stub).\n\nYou can use any other way you are familiar with to include the library into\nthe project.\n\n## Inside\n\n### Levels\n\n  - `common.blocks` — suited for any devices and browsers\n  - `desktop.blocks` — should be used for desktop browsers\n  - `touch.blocks` — implement some touch-platforms specifics\n\n### Blocks\n\n  - `i-bem` — base block with helpers for JS and HTML\n  - `strings` — helpers for JS-strings\n  - `objects` — helpers for JS-objects\n  - `functions` — helpers for JS-functions\n  - `events` — JS-events\n  - `querystring` — helpers for work with querystring\n  - `tick` — global timer\n  - `idle` — IDLE event\n  - `next-tick` — polyfill for `nextTick`/`setTimeout(0, ...)`\n  - `inherit` — OOP helpers\n  - `jquery` — jQuery\n  - `clearfix` — CSS clearfix trick\n  - `identify` — identify JS-objects\n  - `cookie` — helpers for work with browser cookies\n  - `vow` — Promises/A+ implementation\n  - `dom` — helpers for work with DOM\n  - `loader` — loader for JS files\n  - `ua` — browser features detection\n  - `keyboard` — keyboard helpers\n  - `page` — html/head/body scaffold\n\n### Technologies\n\n  - vanilla.js + browser.js\n  - bemhtml\n  - bemtree\n\n## API\n\nThe 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\n\n## Changelog\n\nYou can check the changelog at the [Changelog](https://bem.info/libs/bem-core/changelog/) page.\n\n## Migration\n\nIf you used BEM before, check the [migration instructions](https://bem.info/libs/bem-core/migration/).\n\n## Development\n\n### Working copy\n\n1. Get the needed version code (e.g., `v4`):\n   ```shell\n   $ git clone -b v4 git://github.com/bem/bem-core.git\n   $ cd bem-core\n   ```\n\n2. Install the dependencies:\n   ```shell\n   $ npm install\n   ```\n\n   You need `export PATH=./node_modules/.bin:$PATH`\n   or an alternative way to run locally-installed `npm` dependencies.\n\n3. Install all necessary libraries:\n   ```shell\n   $ npm run deps\n   ```\n\n4. Build and run tests (specs):\n   ```shell\n   $ npm test\n   ```\n\n5. Run development server:\n   ```shell\n   $ npm start\n   ```\n\n### How to contribute\n\nPlease refer to [How to contribute](/CONTRIBUTING.md) guide.\n\n### Modular testing\n\nA default test bundle for `functions__debounce`:\n```shell\n$ magic make desktop.specs/functions__debounce\n```\n\nYou can see the results of the tests in the terminal after the building process finishes.\n\nYou can also watch them in a browser loading `desktop.specs/functions__debounce/spec-js+browser-js+bemhtml/spec-js+browser-js+bemhtml.html`.\n\nRun tests for other BEM entities in the same way. This will work for those which are equipped with `.spec.js` file.\n\n### Code coverage\n\nTo build code coverage report add `ISTANBUL_COVERAGE=yes` environment variable to the tests run command:\n```shell\n$ ISTANBUL_COVERAGE=yes magic make desktop.specs \u0026\u0026 istanbul report html\n```\n\nYou can run modular testing with coverage as well by using more concrete build target as was described above.\n```\n$ ISTANBUL_COVERAGE=yes magic make desktop.specs/functions__debounce \u0026\u0026 istanbul report html\n```\n\nAfter tests finish, you can view coverage HTML report by opening `coverage/index.html` in your favorite\nbrowser.\n\nThe whole code coverage statistics can be found on the [bem-core profile page](https://coveralls.io/r/bem/bem-core) on\n[Coveralls](https://coveralls.io).\n\nTests are built with a [enb-bem-specs](https://github.com/enb-bem/enb-bem-specs/) library.\nCheck the [details](https://ru.bem.info/tools/bem/enb-bem-specs/) (available in Russian only).\n\n## Supported browsers\n\nOur browser support policy is based on statistics we get from [Yandex](https://company.yandex.com) services.\n\nBrowsers with more than 2% users get full compliant support, more than 0.5% — partially compliant\n(which means that data is accessible but not necessary 100% functional). New features testing\nis not provided by us for  browsers with less than 0.5% users.\n\n### Desktop\n\n#### Fully compliant\n\n  - Google Chrome 29+\n  - Firefox 24+\n  - Yandex 1.7+\n  - Opera 12.16\n  - MSIE 10.0\n  - MSIE 9.0\n  - MSIE 8.0\n  - Opera 12.15\n\n#### Partially compliant\n\n  - Opera 17.0\n  - Opera 16.0\n  - Opera 12.14\n  - Opera 12.2\n  - Firefox 23\n\n### Touch\n\n#### Fully compliant\n\n  - iOS 6+\n  - Android 2.3+\n  - Opera Mobile 12+\n  - Windows Phone 7+\n\n#### Partially compliant\n\n  - iOS 5\n  - Android 2.2\n\n## License\nCode and documentation copyright 2012 YANDEX LLC. Code released under the [Mozilla Public License 2.0](LICENSE.txt).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbem%2Fbem-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbem%2Fbem-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbem%2Fbem-core/lists"}