{"id":21414869,"url":"https://github.com/magic/transmute","last_synced_at":"2025-09-04T03:41:17.673Z","repository":{"id":46812500,"uuid":"224751288","full_name":"magic/transmute","owner":"magic","description":"transform html and markdown into magic functional js structures","archived":false,"fork":false,"pushed_at":"2023-02-16T08:44:02.000Z","size":1196,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-08T19:08:43.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magic.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-29T00:55:48.000Z","updated_at":"2021-12-26T18:51:14.000Z","dependencies_parsed_at":"2024-11-22T18:47:20.810Z","dependency_job_id":null,"html_url":"https://github.com/magic/transmute","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/magic/transmute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftransmute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftransmute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftransmute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftransmute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magic","download_url":"https://codeload.github.com/magic/transmute/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftransmute/sbom","scorecard":{"id":611587,"data":{"date":"2025-08-11","repo":{"name":"github.com/magic/transmute","commit":"a20754f2983edab1706681047d5141df7e7eb141"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T02:47:43.758Z","repository_id":46812500,"created_at":"2025-08-21T02:47:43.759Z","updated_at":"2025-08-21T02:47:43.759Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273548656,"owners_count":25125255,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-22T18:34:09.494Z","updated_at":"2025-09-04T03:41:17.643Z","avatar_url":"https://github.com/magic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @magic/transmute\n\ntransmutes html and markdown to @magic view fragments\n\n[![NPM version][npm-image]][npm-url]\n[![Linux Build Status][travis-image]][travis-url]\n[![Windows Build Status][appveyor-image]][appveyor-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n\n### installation\n\n#### cli:\n\n```bash\nnpm i -g @magic/transmute\n\n// executable as magic-transmute now\nmagic-transmute\n```\n\n#### javascript api\n\n```bash\nnpm i --save @magic/transmute\n```\n\n### usage\n\n#### cli:\n\n`magic-transmute --help`\n\n#### commands:\n\n- markdown - convert markdown to magic functions\n- html - convert html to magic functions\n- file - convert file to magic functions\n\n#### flags:\n\n- --add-wrapper - add export default[] to the returned string. - alias: [\"--addWrapper\"]\n- --no-pretty - do not run prettier. - alias: [\"--noPretty\"]\n- --markdown - force markdown parser to run. - alias: [\"--mark\", \"-m\"]\n- --output - output file path - alias: [\"--out\", \"-o\"]\n- --input - input file path - alias: [\"--in\", \"-i\"]\n- --help - this help text - alias: [\"-help\", \"help\", \"--h\", \"-h\"]\n- --str - an input string of either html or markdown, depending on running command\n\n##### transpile html string:\n\n`magic-transmute html --str '\u003ca href=\"https://magic.github.io\"\u003emagic!\u003c/a\u003e'`\n\n##### transpile markdown string:\n\n`magic-transmute markdown --str '[magic!](https://magic.github.io)'`\n\n##### html file:\n\n`magic-transmute file --input input.html --output output.mjs`\n\n##### markdown file\n\n(.markdown and .md get recognized):\n\n`magic-transmute file --input input.md --output output.mjs`\n\n##### force markdown\n\n(arbitrary file extensions)\n\n`magic-transmute file --input input.txt --output output.mjs --markdown`\n\n#### api examples\n\n```javascript\nimport transmute from '@magic/transmute'\n\n// html to magic\ntransmute.html('\u003ca href=\"https://magic.github.io\"\u003emagic!\u003c/a\u003e')\n// returns: `Link({ to: 'https://magic.github.io' }, 'magic!')`\n\n// markdown to magic\ntransmute.markdown('[magic!](https://magic.github.io)')\n// returns: `Link({ to: 'https://magic.github.io' }, 'magic!')`\n\nconst magic = transmute.markdown('[magic!](https://magic.github.io)')\nconsole.log(magic)\n// logs: `Link({ to: 'https://magic.github.io' }, 'magic!')`\n\n// that's it.\n```\n\n#### changelog\n\n##### 0.0.1\n\nfirst release\n\n##### 0.0.2\n\nupdate dependencies\n\n##### 0.0.3\n\nfix cli\n\n##### 0.0.4\n\nupdate @magic dependencies to use npm packages instead of github\n\n##### 0.0.5\n\n- extract state from html and markdown files\n- allow usage of state variables in markdown and html\n\n##### 0.0.6\n\n- pass options from LexLex to marked.Lexer\n- only implant state in html if it has not been passed as argument\n- correctly camelCase object keys for html tags\n- correctly merge passed state with in-file state for markdown and html\n\n##### 0.0.7 - broken\n\nremove commonjs support, node \u003e= 13.5.0 required\n\n##### 0.0.8\n\nexport correct cli file\n\n##### 0.0.9\n\ndo not lowercase @magic-module names, some other minor changes\n\n##### 0.0.10\n\ndo not wrap @magic-modules in p tags\n\n##### 0.0.11\n\n- remove eval from state injection function.\n- correctly handle both ${} and {{}} variables in markdown and html files.\n\n##### 0.0.12\n\nstate keys in ${} and {{ }} get trimmed... doh.\n\n##### 0.0.13\n\nreturn originalState, which is the state derived from the markdown/html file.\nthis allows @magic to use this state for individual pages when building them.\n\n##### 0.0.14\n\n##### FULL @magic-module api available from markdown.\n\n- nested state variables in template strings eg {{state.test.deep.var}} now work.\n- replace parse5 with posthtml.\n- custom markdown and custom html renderers added.\n- @magic-modules in markdown and html can have keys that are arrays or objects now.\n\n##### 0.0.15\n\nif the value of a ${state.variable} in a template string is an array, this array gets join(' ')ed\n\n##### 0.0.16\n\nrender/html: empty arrays and objects return an empty string.\n\n##### 0.0.17\n\nrender/markdown.codespan: do not show linenumbers for codespans.\n\n##### 0.0.18\n\n- handle \u0026quot; escapes.\n- string delimiters ', \" AND ` in a string do not error, get escaped instead.\n\n##### 0.0.19\n\n- actually escape multiple html entities in a string, not just the first occurrence\n\n##### 0.0.20\n\nupdate dependencies\n\n##### 0.0.21\n\nupdate dependencies\n\n##### 0.0.22\n\nupdate prettier, @magic/cli\n\n##### 0.0.23\n\nLink and Img do not get wrapped in a paragraph (anymore)\n\n##### 0.0.24\n\nupdate marked and prettier\n\n##### 0.0.25\n\nupdate dependencies\n\n##### 0.0.26\n\n- bump required node version to 14.2.0\n- update dependencies\n\n##### 0.0.27\n\n- update dependencies\n- FIX: command line interface was broken.\n\n##### 0.0.28\n\n- update dependencies\n- move magic-modules/no-spy to devDependencies\n\n##### 0.0.29\n\nupdate dependencies\n\n##### 0.0.30\n\nupdate dependencies\n\n##### 0.0.31\n\nupdate dependencies\n\n##### 0.0.32\n\nupdate dependencies\n\n##### 0.0.33\n\n- update dependencies\n- fix markdown html handling changes\n\n##### 0.0.34\n\n- update dependencies\n\n##### 0.0.35\n\nupdate dependencies\n\n##### 0.0.36\n\nupdate dependencies\n\n##### 0.0.37\n\n- bump required node version to 14.15.4\n- update dependencies\n\n##### 0.0.38\n\nupdate dependencies\n\n##### 0.0.39\n\nupdate dependencies (marked)\n\n##### 0.0.40\n\nupdate dependencies (posthtml-parser)\n\n##### 0.0.41\n\nremove call to undefined cleanUrl from markdown.image\n\n##### 0.0.42\n\nupdate dependencies\n\n##### 0.0.43\n\n- if the array returned by transmute has a length of 1, return that item instead\n- update dependencies\n\n##### 0.0.44\n\ndo return arrays in all cases. adapt tests to accomodate for that\n\n##### 0.0.45\n\nupdate dependencies\n\n##### 0.0.46\n\nupdate dependencies to avoid circular dependencies in @magic/types\n\n##### 0.0.47\n\nupdate dependencies\n\n##### 0.0.48\n\nupdate dependencies\n\n##### 0.0.49\n\nupdate dependencies\n\n##### 0.0.50\n\nupdate dependencies\n\n##### 0.0.51\n\nupdate dependencies\n\n##### 0.0.52\n\nupdate dependencies\n\n##### 0.0.53\n\nupdate dependencies\n\n##### 0.0.54\n\nupdate dependencies\n\n##### 0.0.55\n\nupdate dependencies\n\n##### 0.0.56\n\nupdate dependencies\n\n##### 0.0.57\n\nupdate dependencies\n\n##### 0.0.58 - unreleased\n\n...\n\n[npm-image]: https://img.shields.io/npm/v/@magic/transmute.svg\n[npm-url]: https://www.npmjs.com/package/@magic/transmute\n[travis-image]: https://img.shields.io/travis/com/magic/transmute/master\n[travis-url]: https://travis-ci.com/magic/transmute\n[appveyor-image]: https://img.shields.io/appveyor/ci/magic/transmute/master.svg\n[appveyor-url]: https://ci.appveyor.com/project/magic/transmute/branch/master\n[coveralls-image]: https://coveralls.io/repos/github/magic/transmute/badge.svg\n[coveralls-url]: https://coveralls.io/github/magic/transmute\n[snyk-image]: https://snyk.io/test/github/magic/transmute/badge.svg\n[snyk-url]: https://snyk.io/test/github/magic/transmute\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Ftransmute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagic%2Ftransmute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Ftransmute/lists"}