{"id":24983703,"url":"https://github.com/posthtml/posthtml-class-to-css-module","last_synced_at":"2026-03-13T08:01:17.916Z","repository":{"id":57328791,"uuid":"85570638","full_name":"posthtml/posthtml-class-to-css-module","owner":"posthtml","description":"A posthtml plugin for clone class to attribute css-module","archived":false,"fork":false,"pushed_at":"2018-03-15T09:41:03.000Z","size":88,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T12:33:58.670Z","etag":null,"topics":["clone","css","css-modules","modules","posthtml","posthtml-plugin"],"latest_commit_sha":null,"homepage":null,"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/posthtml.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","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":"2017-03-20T11:48:01.000Z","updated_at":"2018-03-15T09:41:05.000Z","dependencies_parsed_at":"2022-08-29T10:01:43.676Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-class-to-css-module","commit_stats":null,"previous_names":["gitscrum/posthtml-class-to-css-module"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/posthtml/posthtml-class-to-css-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-class-to-css-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-class-to-css-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-class-to-css-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-class-to-css-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-class-to-css-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-class-to-css-module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30462020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T06:34:02.089Z","status":"ssl_error","status_checked_at":"2026-03-13T06:33:49.182Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["clone","css","css-modules","modules","posthtml","posthtml-plugin"],"created_at":"2025-02-04T09:20:33.485Z","updated_at":"2026-03-13T08:01:17.872Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"# posthtml-class-to-css-module\n\n\u003e A [posthtml](https://github.com/posthtml) A posthtml plugin for clone `class` to attribute `css-module`\n\n[![Travis Build Status](https://img.shields.io/travis/posthtml/posthtml-class-to-css-module/master.svg?style=flat-square\u0026label=unix)](https://travis-ci.org/posthtml/posthtml-class-to-css-module)[![node](https://img.shields.io/node/v/post-sequence.svg?maxAge=2592000\u0026style=flat-square)]()[![npm version](https://img.shields.io/npm/v/posthtml-class-to-css-module.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-class-to-css-module)[![Dependency Status](https://david-dm.org/gitscrum/posthtml-class-to-css-module.svg?style=flat-square)](https://david-dm.org/gitscrum/posthtml-class-to-css-module)[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square)](https://github.com/sindresorhus/xo)[![Coveralls status](https://img.shields.io/coveralls/posthtml/posthtml-class-to-css-module.svg?style=flat-square)](https://coveralls.io/r/posthtml/posthtml-class-to-css-module)\n\n[![npm downloads](https://img.shields.io/npm/dm/posthtml-class-to-css-module.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-class-to-css-module)[![npm](https://img.shields.io/npm/dt/posthtml-class-to-css-module.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-class-to-css-module)\n\n## Why?\nThe plugin for cloning classes in the attribute `css-module` when used together with [posthtml-css-modules](https://github.com/posthtml/posthtml-css-modules)\n\n## Install\n\n```bash\nnpm i -D posthtml posthtml-class-to-css-module\n```\n\n\u003e **Note:** This project is compatible with node v4+\n\n## Usage\n\n```js\nimport {readFileSync, writeFileSync} from 'fs';\nimport posthtml from 'posthtml';\nimport clone from 'posthtml-class-to-css-module';\n\nconst html = readFileSync('input.html', 'utf8');\n\nposthtml()\n    .use(clone())\n    .process(html)\n    .then(result =\u003e {\n        writeFileSync('output.html', result.html);\n    });\n\n```\nReturns the html with cloned classes in the attribute `css-module`\n\n## Example\n\n#### input.html\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\u003c/head\u003e\n    \u003cbody class=\"class-for-body\"\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### output.html\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\u003c/head\u003e\n    \u003cbody class=\"class-for-body\" css-module=\"class-for-body\"\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Options\n\n### `removeClass`\nType: `Boolean`  \nDefault: false  \nDescription: *Removes the `class` attribute after cloning the `class` value to an attribute `css-module`*  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-class-to-css-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-class-to-css-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-class-to-css-module/lists"}