{"id":24762244,"url":"https://github.com/uxter/bemcn","last_synced_at":"2025-10-07T00:12:31.494Z","repository":{"id":143855237,"uuid":"108599878","full_name":"uxter/bemcn","owner":"uxter","description":":boom: Utility for creating BEM class names.","archived":false,"fork":false,"pushed_at":"2017-11-29T07:41:06.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T03:13:29.487Z","etag":null,"topics":["bem","bem-methodology","block","classnames","element","modifier"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uxter.png","metadata":{"files":{"readme":"README.hbs","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-27T22:03:23.000Z","updated_at":"2023-01-27T19:54:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3749881c-5115-462c-bc34-5fa0d468d0fc","html_url":"https://github.com/uxter/bemcn","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uxter%2Fbemcn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uxter%2Fbemcn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uxter%2Fbemcn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uxter%2Fbemcn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uxter","download_url":"https://codeload.github.com/uxter/bemcn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245107459,"owners_count":20561862,"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","bem-methodology","block","classnames","element","modifier"],"created_at":"2025-01-28T19:29:11.285Z","updated_at":"2025-10-07T00:12:26.457Z","avatar_url":"https://github.com/uxter.png","language":"JavaScript","readme":"[![view on npm](http://img.shields.io/npm/v/bemcn.svg)](https://www.npmjs.org/package/bemcn)\n[![npm module downloads](http://img.shields.io/npm/dt/bemcn.svg)](https://www.npmjs.org/package/bemcn)\n[![Build Status](https://travis-ci.org/uxter/bemcn.svg?branch=master)](https://travis-ci.org/uxter/bemcn)\n[![Coverage Status](https://codecov.io/gh/uxter/bemcn/branch/master/graph/badge.svg)](https://codecov.io/gh/uxter/bemcn)\n[![Dependency Status](https://david-dm.org/uxter/bemcn.svg)](https://david-dm.org/uxter/bemcn)\n[![Join the chat at https://gitter.im/bemcn](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bemcn?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n# bemcn\n\nbemcn is an utility for creating BEM class names.\n\n## Explanation\n\n```js\nvar bc = bemcn('__', '--');\n\nbc('b')()()             // b\nbc('b')()('m')          // b--m\nbc('b')()('m', true)    // b b--m\nbc('b')('e')()          // b__e\nbc('b')('e')('m')       // b__e--m\nbc('b')('e')('m', true) // b__e b__e--m\n```\n\n```js\nvar bc = bemcn('__', '--', true);\n\nbc('b')()()              // b\nbc('b')()('m', false)    // b--m\nbc('b')()('m')           // b b--m\nbc('b')('e')()           // b__e\nbc('b')('e')('m', false) // b__e--m\nbc('b')('e')('m')        // b__e b__e--m\n```\n\n## Install\n\n```\n$ npm install --save bemcn\n```\n\n## Usage\n\n#### Browser\n\n```html\n\u003cscript src=\"path/to/bemcn.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    var bcn = bemcn('__', '--');\n    bcn('block')('element')('modifier');\n\u003c/script\u003e\n```\n\n#### AMD\n\n```js\nrequirejs(['path/to/bemcn'], function(bemcn) {\n    var bcn = bemcn('__', '--');\n    bcn('block')('element')('modifier');\n});\n```\n\n#### Node.js\n\n```js\nvar bemcn = require('bemcn');\nvar bcn = bemcn('__', '--');\nbcn('block')('element')('modifier');\n```\n\n{{\u003emain}}\n\n## Example\n\n```js\nvar bcn = bemcn('__', '--', true);\nvar form = bcn('form');\nvar field = form('field');\nvar label = form('label');\n\nform()('inline') // form form--inline\nfield()          // form__field\nfield('error')   // form__field form__field--error\nlabel()          // form__label\nlabel('hidden')  // form__label form__label--hidden\n```\n\n## Note on Patches/Pull Requests\n\n1. Fork the project.\n2. Make your feature addition or bug fix.\n3. Send me a pull request.\n\n* * *\n\n\u0026copy; 2017 Vasily Shilov\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxter%2Fbemcn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuxter%2Fbemcn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuxter%2Fbemcn/lists"}