{"id":24535907,"url":"https://github.com/posthtml/posthtml-jsx","last_synced_at":"2025-04-15T00:32:26.679Z","repository":{"id":57339125,"uuid":"65737267","full_name":"posthtml/posthtml-jsx","owner":"posthtml","description":"JSX Renderer","archived":false,"fork":false,"pushed_at":"2018-12-25T13:17:03.000Z","size":13,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T21:06:06.289Z","etag":null,"topics":[],"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/posthtml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-15T14:11:37.000Z","updated_at":"2022-05-16T12:00:48.000Z","dependencies_parsed_at":"2022-08-28T10:00:44.925Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-jsx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-jsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-jsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-jsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-jsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-jsx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248662530,"owners_count":21141588,"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":[],"created_at":"2025-01-22T13:29:11.009Z","updated_at":"2025-04-15T00:32:26.653Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"[![NPM][npm]][npm-url]\n[![Deps][deps]][deps-url]\n[![Tests][build]][build-url]\n[![Coverage][cover]][cover-url]\n[![Standard Code Style][style]][style-url]\n[![Chat][chat]][chat-badge]\n\n# PostHTML JSX \u003cimg align=\"right\" width=\"200\" height=\"220\" title=\"PostHTML\" src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n\n## Install\n\n```bash\nnpm i -D posthtml-jsx\n```\n\n## Usage\n\n```js\nposthtml(plugins)\n  .process(html, { render: jsx(options) })\n  .then(({ html }) =\u003e console.log(html))\n```\n\n## Options\n\n**`type`:** `{String}`: Type of the Component ( es5 || es2015 || stateless )\n\n**`name`:** `{String}`: Name of the Component\n\n**`props`:** `{String|Array}`: Props of the Component\n\n**`export`:** `{Boolean}`: Export Component JS Module (true || false)\n\n## Example\n\n```js\nimport { readFileSync, writeFileSync } from 'fs'\n\nimport posthtml from 'posthtml'\nimport jsx from 'posthtml-jsx'\n\nconst html = readFileSync('./index.html', 'utf8')\n\nposthtml()\n  .process(html, {\n    render: jsx({\n      type: 'es2015'\n      name: 'Test'\n      props: ['prop', '{ prop }', '...props']\n      export: true\n    })\n  })\n  .then((result) =\u003e writeFileSync('./Test.jsx', result.html, 'utf8'))\n```\n\n```html\n\u003cdiv id={id} class={container}\u003e\n  {content}\n\u003c/div\u003e\n```\n\n```js\nimport { Component } from 'react'\n\nclass Test extends Component {\n  render (prop, { prop }, ...props) {\n    return (\n      \u003cdiv id={test.id} className={test.class}\u003e\n        {test.content}\n      \u003c/div\u003e\n    )\n  }\n}\n\nexport default Test\n```\n\n## Maintainers\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n   \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg width=\"150 height=\"150\"\n      src=\"https://avatars.githubusercontent.com/u/5419992?v=3\u0026s=150\"\u003e\n      \u003cbr /\u003e\n      \u003ca href=\"https://github.com/michael-ciniawsky\"\u003eMichael Ciniawsky\u003c/a\u003e\n    \u003c/td\u003e\n   \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n## Contributing\n\nSee [PostHTML Guidelines](https://github.com/posthtml/posthtml/tree/master/docs) and [CONTRIBUTING](CONTRIBUTING.md).\n\n## LICENSE\n\n[MIT](LICENSE)\n\n[npm]: https://img.shields.io/npm/v/posthtml-jsx.svg\n[npm-url]: https://npmjs.com/package/posthtml-jsx\n\n[deps]: https://david-dm.org/posthtml/posthtml-jsx.svg\n[deps-url]: https://david-dm.org/posthtml/posthtml-jsx\n\n[build]: http://img.shields.io/travis/posthtml/posthtml-jsx.svg\n[build-url]: https://travis-ci.org/posthtml/posthtml-jsx\n\n[cover]: https://coveralls.io/repos/github/posthtml/posthtml-jsx/badge.svg?branch=master\n[cover-url]: https://coveralls.io/github/posthtml/posthtml-jsx?branch=master\n\n[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg\n[style-url]: http://standardjs.com/\n\n[chat]: https://badges.gitter.im/posthtml/posthtml.svg\n[chat-badge]: https://gitter.im/posthtml/posthtml?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-jsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-jsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-jsx/lists"}