{"id":16261285,"url":"https://github.com/fuxingloh/remark-code-import-replace","last_synced_at":"2026-04-24T16:07:20.561Z","repository":{"id":55574581,"uuid":"323275671","full_name":"fuxingloh/remark-code-import-replace","owner":"fuxingloh","description":"Remark to import code block and optionally replace the code block to another syntax tree.","archived":false,"fork":false,"pushed_at":"2020-12-21T09:03:20.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T10:56:27.175Z","etag":null,"topics":["code","codeblock","markdown","remark","snippet","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fuxingloh.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":"2020-12-21T08:31:10.000Z","updated_at":"2021-01-01T11:05:24.000Z","dependencies_parsed_at":"2022-08-15T03:30:35.153Z","dependency_job_id":null,"html_url":"https://github.com/fuxingloh/remark-code-import-replace","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fuxingloh/remark-code-import-replace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuxingloh%2Fremark-code-import-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuxingloh%2Fremark-code-import-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuxingloh%2Fremark-code-import-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuxingloh%2Fremark-code-import-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuxingloh","download_url":"https://codeload.github.com/fuxingloh/remark-code-import-replace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuxingloh%2Fremark-code-import-replace/sbom","scorecard":{"id":414951,"data":{"date":"2025-08-11","repo":{"name":"github.com/fuxingloh/remark-code-import-replace","commit":"81f9c80f1038cfa9c3bade5b7b150293e0f1b9f7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/draft.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/draft.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-triage.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/pr-triage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-triage.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/pr-triage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/fuxingloh/remark-code-import-replace/publish.yml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"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":"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":"Code-Review","score":0,"reason":"Found 0/4 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/draft.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-triage.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"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":"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: MIT License: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq"],"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-18T23:35:27.122Z","repository_id":55574581,"created_at":"2025-08-18T23:35:27.122Z","updated_at":"2025-08-18T23:35:27.122Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: 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":["code","codeblock","markdown","remark","snippet","typescript"],"created_at":"2024-10-10T16:41:01.331Z","updated_at":"2026-04-24T16:07:20.522Z","avatar_url":"https://github.com/fuxingloh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remark Code Import Replace [![remark-code-import-replace](https://img.shields.io/npm/v/remark-code-import-replace.svg)](https://www.npmjs.com/package/remark-code-import-replace)\n\n![CI](https://github.com/fuxingloh/remark-code-import-replace/workflows/CI/badge.svg)\n[![License MIT](https://img.shields.io/github/license/fuxingloh/remark-code-import-replace)](https://github.com/fuxingloh/vue-horizontal/blob/main/LICENSE)\n\nRemark code file import and optionally replace the code block.\n\n## Basic usage\n\n\u003cpre lang=\"md\"\u003e\n```js import=code.js\n```\n\u003c/pre\u003e\n\n\n## Code import and replace node\n\n\u003e `replace` will only run if `import=` is set.\n\n\u003cpre lang=\"md\"\u003e\n```js import=code.js render param\n```\n\u003c/pre\u003e\n\n### Remark options\n```js\nexport default {\n  remark: ['remark-code-import-replace', {\n    // optionally override baseDir\n    baseDir: '/snippets',\n    replace: (node, meta, {u}) =\u003e {\n      // Access any meta declared in codeblock\n      if (meta.param) {\n        return [node]\n      }\n\n      // e.g. to wraped into another component\n      if (meta.render) {\n        return [\n          u('html', {value: `\u003cdiv\u003e`}),\n          node,\n          u('html', {value: `\u003c/div\u003e`}),\n        ]\n      }\n    },\n  }]\n}\n```\n\n## Using with Nuxt Content and Components\n\n- Code file import\n- Register a new directory for global import \n- Replace and add a new node with the name of the component\n\n```js\n// nuxt.config.js\nexport default {\n  content: {\n    markdown: {\n      remarkPlugins: [\n        ['remark-code-import-replace', {\n          replace: (node, meta, {u}) =\u003e {\n            return [\n              u('html', {value: `\u003c${meta.file.name}\u003e`}),\n              u('html', {value: `\u003c/${meta.file.name}\u003e`}),\n              node,\n            ]\n          }\n        }]\n      ],\n    },\n  },\n  hooks: {\n    'components:dirs': async (dirs) =\u003e {\n      dirs.push({\n        path: \"~/content\",\n        global: true\n      })\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuxingloh%2Fremark-code-import-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuxingloh%2Fremark-code-import-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuxingloh%2Fremark-code-import-replace/lists"}