{"id":13839221,"url":"https://github.com/goto-bus-stop/babel-plugin-yo-yoify","last_synced_at":"2025-10-02T23:35:52.563Z","repository":{"id":57188972,"uuid":"80371379","full_name":"goto-bus-stop/babel-plugin-yo-yoify","owner":"goto-bus-stop","description":"Babel plugin to transform yo-yo or bel template strings into pure and fast document calls.","archived":true,"fork":false,"pushed_at":"2018-03-23T08:33:14.000Z","size":117,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-24T08:02:16.314Z","etag":null,"topics":["babel-plugin","bel","choo","template-literals","yo-yo","yo-yoify"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/babel-plugin-yo-yoify","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/goto-bus-stop.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":"2017-01-29T20:43:51.000Z","updated_at":"2023-01-28T20:57:04.000Z","dependencies_parsed_at":"2022-08-28T11:11:19.528Z","dependency_job_id":null,"html_url":"https://github.com/goto-bus-stop/babel-plugin-yo-yoify","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fbabel-plugin-yo-yoify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fbabel-plugin-yo-yoify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fbabel-plugin-yo-yoify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fbabel-plugin-yo-yoify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goto-bus-stop","download_url":"https://codeload.github.com/goto-bus-stop/babel-plugin-yo-yoify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219876112,"owners_count":16554735,"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":["babel-plugin","bel","choo","template-literals","yo-yo","yo-yoify"],"created_at":"2024-08-04T16:00:55.109Z","updated_at":"2025-10-02T23:35:47.279Z","avatar_url":"https://github.com/goto-bus-stop.png","language":"JavaScript","funding_links":[],"categories":["Build tools"],"sub_categories":[],"readme":"# DEPRECATED\n\nThis plugin was merged with [nanohtml](https://github.com/choojs/nanohtml).\nPlease use that instead!\n\n```js\n// .babelrc\n{\n  \"plugins\": [\"nanohtml\"]\n}\n```\n\n# babel-plugin-yo-yoify\n\nLike [yo-yoify][], but as a Babel plugin. Transform [yo-yo][] or [bel][]\ntemplate strings into raw document calls.\n\n## Installation\n\n```bash\nnpm install --save-dev babel-plugin-yo-yoify\n# And:\nnpm install --save yo-yoify\n```\n\n`yo-yoify` is used in the compiled output of `babel-plugin-yo-yoify`, so it must\nbe installed next to it.\n\n## Example\n\nUsing `babel --plugins yo-yoify | prettier --stdin`:\n\n**In**\n\n```js\nimport html from 'bel'\n\nconst title = 'yo-yoify'\nconst header = html`\n  \u003cheader id=\"page-header\"\u003e\n    \u003ch1\u003e${title}\u003c/h1\u003e\n    \u003cbutton onclick=${event =\u003e alert('Hello world!')}\u003eClick here\u003c/button\u003e\n  \u003c/header\u003e\n`\n```\n\n**Out**\n\n```js\nvar _h, _button, _pageHeader;\n\nvar _appendChild = require('yo-yoify/lib/appendChild');\n\nconst title = 'yo-yoify';\nconst header = (_pageHeader = document.createElement(\n  'header'\n), _pageHeader.setAttribute('id', 'page-header'), _appendChild(_pageHeader, [\n  '\\n    ',\n  (_h = document.createElement('h1'), _appendChild(_h, [title]), _h),\n  '\\n    ',\n  (_button = document.createElement('button'), _button.onclick = event =\u003e\n    alert('Hello world!'), _button.textContent = 'Click here', _button),\n  '\\n  '\n]), _pageHeader);\n```\n\n## Usage\n\nWithout options:\n\n```js\n// .babelrc\n{\n  \"plugins\": [\n    \"yo-yoify\"\n  ]\n}\n```\n\nWith options:\n\n```js\n// .babelrc\n{\n  \"plugins\": [\n    [\"yo-yoify\", {\n      \"useImport\": true\n    }]\n  ]\n}\n```\n\n### bel v5\n\nWhen used with `bel` v5.1.3 or up, it's recommended to tell\nbabel-plugin-yo-yoify to use bel's exported `appendChild` function. This way,\nthe transformed output will always use the same appending and white space\nhandling logic as the original source.\n\n```js\n{\n  \"plugins\": [\n    [\"yo-yoify\", {\n      \"appendChildModule\": \"bel/appendChild\"\n    }]\n  ]\n}\n```\n\nbel versions v5.1.2 and below do not export the `appendChild` function--for\nthose, the default `\"yo-yoify/lib/appendChild\"` function is used instead. This\nfunction may have different behaviour from the bel version being used, though.\n\n## Options\n\n - `useImport` - Set to true to use `import` statements for injected modules.\n   By default, `require` is used. Enable this if you're using Rollup.\n - `appendChildModule` - Import path to a module that contains an `appendChild`\n   function. Set this to `\"bel/appendChild\"` when using bel v5.1.3 or up!\n   Defaults to `\"yo-yoify/lib/appendChild\"`.\n\n## License\n\n[ISC][]\n\n[yo-yoify]: https://github.com/shama/yo-yoify\n[yo-yo]: https://github.com/maxogden/yo-yo\n[bel]: https://github.com/shama/bel\n[ISC]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoto-bus-stop%2Fbabel-plugin-yo-yoify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoto-bus-stop%2Fbabel-plugin-yo-yoify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoto-bus-stop%2Fbabel-plugin-yo-yoify/lists"}