{"id":15044802,"url":"https://github.com/ideyuta/nbem","last_synced_at":"2025-10-24T14:30:38.567Z","repository":{"id":57309113,"uuid":"43595491","full_name":"ideyuta/nbem","owner":"ideyuta","description":":gem: nbem is for intuitively write the class name of BEM method. React and others.","archived":false,"fork":false,"pushed_at":"2017-03-31T08:48:09.000Z","size":36,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T01:57:46.185Z","etag":null,"topics":["bem","class","css","js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ideyuta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-03T10:27:09.000Z","updated_at":"2023-03-10T10:15:53.000Z","dependencies_parsed_at":"2022-09-01T06:31:33.266Z","dependency_job_id":null,"html_url":"https://github.com/ideyuta/nbem","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideyuta%2Fnbem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideyuta%2Fnbem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideyuta%2Fnbem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideyuta%2Fnbem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ideyuta","download_url":"https://codeload.github.com/ideyuta/nbem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237981904,"owners_count":19397152,"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","class","css","js"],"created_at":"2024-09-24T20:51:03.994Z","updated_at":"2025-10-24T14:30:33.059Z","avatar_url":"https://github.com/ideyuta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nbem\n\n\u003e nbem is for intuitively write the class name of BEM method.\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][npm-download-image]][npm-download-url]\n[![Build Status][travis-image]][travis-url]\n[![Dependency Status][daviddm-image]][daviddm-url]\n[![DevDependency Status][daviddm-dev-image]][daviddm-dev-url]\n[![License][license-image]][license-url]\n\n## Installation\n\n```\nnpm i nbem\n```\n\n## Usage\n\n##### Use with node.js, browserify, webpack:\n\n```js\nvar nbem = require(nbem);\nvar bem = nbem();\n```\n\n'\u0026' is indicates the nests.\n\n```js\nbem('header'); // =\u003e \"header\"\nbem('\u0026nav'); // =\u003e \"header__nav\"\nbem('\u0026\u0026item'); // =\u003e \"header__nav__item\"\n```\n\n':' is indicates the modifier.\n\n```js\nbem('header:global'); // =\u003e \"header--global\"\nbem('\u0026nav'); // =\u003e \"header--global__nav\"\n```\n\n##### Join classnames:\n\nAdd a string or string[] at second argument.\n\n```js\nbem('header'); // =\u003e \"header\"\nbem('\u0026nav', 'isActive'); // =\u003e \"header__nav isActive\"\nbem('\u0026nav', ['isActive', 'isHover']); // =\u003e \"header__nav isActive isHover\"\nbem('\u0026\u0026item'); // =\u003e \"header__nav__item\"\n```\n\n##### Customize separator:\n\n```js\nvar config = require(nbem).config;\nconfig.setSeparator('-', '_'); // element, modifier\n\nbem('header:global'); // =\u003e \"header-global\"\nbem('\u0026title') // =\u003e \"header-global_title\"\n```\n\n## Example\n\nin React of ES6\n\n```js\nimport React from 'react';\nimport nbem from 'nbem';\n\nexport default class Header extends React.Component {\n  render() {\n    const bem = nbem();\n    return (\n      \u003cheader className={bem('header')}\u003e\n        \u003ch1 className={bem('\u0026title')}\u003eTitle\u003c/h1\u003e\n        \u003cp className={bem('\u0026description')\u003eDescription\u003c/p\u003e\n      \u003c/header\u003e\n    );\n  }\n}\n```\n\nRender:\n```html\n\u003cheader class=\"header\"\u003e\n  \u003ch1 class=\"header__title\"\u003eTitle\u003c/h1\u003e\n  \u003cp class=\"header__description\"\u003eDescription\u003c/p\u003e\n\u003c/header\u003e\n```\n\n[npm-url]: https://www.npmjs.com/package/nbem\n[npm-image]: https://img.shields.io/npm/v/nbem.svg?style=flat-square\n[npm-download-url]: https://www.npmjs.com/package/nbem\n[npm-download-image]: https://img.shields.io/npm/dt/nbem.svg?style=flat-square\n[travis-url]: https://travis-ci.org/ideyuta/nbem\n[travis-image]: https://img.shields.io/travis/ideyuta/nbem.svg?style=flat-square\n[daviddm-url]: https://david-dm.org/ideyuta/nbem\n[daviddm-image]: https://img.shields.io/david/ideyuta/nbem.svg?style=flat-square\n[daviddm-dev-url]: https://david-dm.org/ideyuta/nbem#info=devDependencies\n[daviddm-dev-image]: https://img.shields.io/david/dev/ideyuta/nbem.svg?style=flat-square\n[license-url]: http://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/nbem.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fideyuta%2Fnbem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fideyuta%2Fnbem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fideyuta%2Fnbem/lists"}