{"id":23081369,"url":"https://github.com/lagden/injection","last_synced_at":"2026-04-24T16:35:29.129Z","repository":{"id":42226231,"uuid":"153414736","full_name":"lagden/injection","owner":"lagden","description":"Inject data into file","archived":false,"fork":false,"pushed_at":"2023-03-04T02:55:31.000Z","size":1158,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T17:12:58.004Z","etag":null,"topics":["data","file","inject","nodejs"],"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/lagden.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":"2018-10-17T07:32:44.000Z","updated_at":"2021-03-02T13:50:06.000Z","dependencies_parsed_at":"2024-12-16T13:53:23.369Z","dependency_job_id":"2c974d4b-23b0-478a-b483-cb5fe3997230","html_url":"https://github.com/lagden/injection","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"f7b6e1b0df86ef72e5a163562f10841f9a4e6129"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lagden/injection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagden%2Finjection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagden%2Finjection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagden%2Finjection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagden%2Finjection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lagden","download_url":"https://codeload.github.com/lagden/injection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagden%2Finjection/sbom","scorecard":{"id":577051,"data":{"date":"2025-08-11","repo":{"name":"github.com/lagden/injection","commit":"f7b6e1b0df86ef72e5a163562f10841f9a4e6129"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/17 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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: bin/zera:13","Info:   0 out of   1 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":"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":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":0,"reason":"34 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-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"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-20T18:07:44.768Z","repository_id":42226231,"created_at":"2025-08-20T18:07:44.768Z","updated_at":"2025-08-20T18:07:44.768Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32231097,"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":["data","file","inject","nodejs"],"created_at":"2024-12-16T13:51:55.867Z","updated_at":"2026-04-24T16:35:29.112Z","avatar_url":"https://github.com/lagden.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Injection\n\n[![NPM version][npm-img]][npm]\n[![Build Status][ci-img]][ci]\n[![Coverage Status][coveralls-img]][coveralls]\n[![XO code style][xo-img]][xo]\n\n\n[npm-img]:         https://img.shields.io/npm/v/@tadashi/injection.svg\n[npm]:             https://www.npmjs.com/package/@tadashi/injection\n[ci-img]:          https://travis-ci.org/lagden/injection.svg\n[ci]:              https://travis-ci.org/lagden/injection\n[coveralls-img]:   https://coveralls.io/repos/github/lagden/injection/badge.svg?branch=master\n[coveralls]:       https://coveralls.io/github/lagden/injection?branch=master\n[xo-img]:          https://img.shields.io/badge/code_style-XO-5ed9c7.svg\n[xo]:              https://github.com/sindresorhus/xo\n\n\nInject data into file\n\n\n## Install\n\n```\n$ npm i -S @tadashi/injection\n```\n\n\n## Sample\n\nThis is the file that will be inject: `script.js`  \n```js\nconst a = 'Horray';\nalert(a);\n```\n\nThis is the source file with the markup showing where is the place will be injected: `input.html`  \n```html\n\u003cbody\u003e\n  \u003cscript\u003e/* inject: ./script.js */\u003c/script\u003e\n\u003c/body\u003e\n```\n\nMaking injection specifying the output file  \n```js\nconst injection = require('@tadashi/injection');\n\n(async () =\u003e {\n  await injection('./input.html', './output.html', '\\/\\\\*\\\\sinject:\\\\s([\\\\w./]+)\\\\s\\\\*\\\\/')\n})()\n```\n\nResult: `output.html`  \n```html\n\u003cbody\u003e\u003cscript\u003econst a = 'Horray';alert(a);\u003c/script\u003e\u003c/body\u003e\n```\n\n\n### API\n\n#### injection(input[, output][, pattern])\n\nName        | Type                 | Required    | Default                             | Description\n----------- | -------------------- | :---------: | :---------------------------------: | ------------\ninput       | string               | yes         | -                                   | Source file\noutput      | string               | no          | ./out                               | Result file\npattern     | string               | no          | `\u003c!--\\\\sinject:\\\\s([\\\\w./]+)\\\\s--\u003e` | RegExp pattern\n\n\n## License\n\nMIT © [Thiago Lagden](https://github.com/lagden)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flagden%2Finjection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flagden%2Finjection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flagden%2Finjection/lists"}