{"id":20226607,"url":"https://github.com/shekhei/dust-scriptjs-helper","last_synced_at":"2026-07-10T03:31:05.574Z","repository":{"id":57217255,"uuid":"53848056","full_name":"shekhei/dust-scriptjs-helper","owner":"shekhei","description":"scriptjs helpers for dustjs","archived":false,"fork":false,"pushed_at":"2016-03-18T09:18:04.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T09:49:25.484Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shekhei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-14T10:41:51.000Z","updated_at":"2016-03-15T05:36:15.000Z","dependencies_parsed_at":"2022-08-28T21:40:27.734Z","dependency_job_id":null,"html_url":"https://github.com/shekhei/dust-scriptjs-helper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/shekhei/dust-scriptjs-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhei%2Fdust-scriptjs-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhei%2Fdust-scriptjs-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhei%2Fdust-scriptjs-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhei%2Fdust-scriptjs-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shekhei","download_url":"https://codeload.github.com/shekhei/dust-scriptjs-helper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekhei%2Fdust-scriptjs-helper/sbom","scorecard":{"id":817447,"data":{"date":"2025-08-11","repo":{"name":"github.com/shekhei/dust-scriptjs-helper","commit":"5fc47f5a2ef9497e50a087bafe6cefc7eea7c07d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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"}}]},"last_synced_at":"2025-08-23T14:33:23.784Z","repository_id":57217255,"created_at":"2025-08-23T14:33:23.784Z","updated_at":"2025-08-23T14:33:23.784Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35319810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"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-14T07:19:16.709Z","updated_at":"2026-07-10T03:31:05.555Z","avatar_url":"https://github.com/shekhei.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A set of helpers for using [script.js](http://github.com/ded/script.js) as async dependency loader with [dust.js](http://github.com/linkedin/dustjs)\n\n\n## What does it do?\n\nBasically it helps you build your script.js code, and if any depended bundle is not requested, it will not be built. It builds a very simple graph internally and is used to build the code\n\n### Not loading of unnecessary bundles\n\nThe following code is very much similar to the above code, except, the final set of script only depends on bundle(\"two\") and as you can see the final result is much shorter(since bundle three is not loaded, bundle one is not needed)\n\n```html\n\u003c!doctype html\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003c!-- you must first include script.js on your own --\u003e\n\u003c!-- now you can add your dependencies --\u003e\n{@bundleScript bundle=\"one\" src=\"one.js\"/}\n{@bundleScript bundle=\"two\" src=\"two.js\"/}\n{@bundleScript bundle=\"three\" src=\"three.js\"/}\n{@bundleDepends bundle=\"three\"}\n{@dependsOn bundle=\"one\"/}\n{@dependsOn bundle=\"two\"/}\n{/bundleDepends}\n{@scriptjs}\n{@dependsOn bundle=\"two\"/}\n{/scriptjs}\n\u003c!-- please include renderScript as late as possible, this is where the script code will be rendered --\u003e\n{@renderScript /}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### output\n```html\n\u003c!doctype html\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cscript\u003e\n$script([\"two.js\"],\"two\");\n$script.ready(\"two\",function(){\n});\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Not repeating the code if possible(still improving)\n\nHere, two scripts depends on \"one\" and \"three\", and \"three\" depends on \"one\" and \"two\", although \"one\" is included by two different sets, but $script() is only called for bundle \"one\" once.\n\n```html\n\u003c!doctype html\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003c!-- you must first include script.js on your own --\u003e\n\u003c!-- now you can add your dependencies --\u003e\n{@bundleScript bundle=\"one\" src=\"one.js\"/}\n{@bundleScript bundle=\"two\" src=\"two.js\"/}\n{@bundleScript bundle=\"three\" src=\"three.js\"/}\n{@bundleDepends bundle=\"three\"}\n{@dependsOn bundle=\"one\"/}\n{@dependsOn bundle=\"two\"/}\n{/bundleDepends}\n{@scriptjs}\n{@dependsOn bundle=\"three\"/}\n{/scriptjs}\n{@scriptjs dependsOn=\"one\"/}\n{/scriptjs}\n\u003c!-- please include renderScript as late as possible, this is where the script code will be rendered --\u003e\n{@renderScript /}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### output\n```html\n\u003c!doctype html\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cscript\u003e\n$script([\"one.js\"],\"one\");\n$script([\"two.js\"],\"two\");\n$script.ready([\"one\",\"two\"],function(){\n  $script([\"three.js\"],\"three\");\n});\n$script.ready(\"three\", function(){\n})\n$script.ready(\"one\", function(){\n})\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Usage\n\n### installation\n```sh\nnpm install --save dust-scriptjs-helper\n```\n\n### nodejs usage\n```javascript\nimport {* as dust} from \"dust-scriptjs-helper\" // this is the decorated dust object with dustjs-helpers\n```\n\n### example\n\n#### dustjs code\n```html\n\u003c!doctype html\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003c!-- you must first include script.js on your own --\u003e\n\u003c!-- now you can add your dependencies --\u003e\n{@bundleScript bundle=\"one\" src=\"one.js\"/}\n{@bundleScript bundle=\"two\" src=\"two.js\"/}\n{@bundleScript bundle=\"three\" src=\"three.js\"/}\n{@bundleDepends bundle=\"three\"}\n{@dependsOn bundle=\"one\"/}\n{@dependsOn bundle=\"two\"/}\n{/bundleDepends}\n{@scriptjs}\n{@dependsOn bundle=\"two\"/}\n{@dependsOn bundle=\"three\"/}\n{/scriptjs}\n\u003c!-- please include renderScript as late as possible, this is where the script code will be rendered --\u003e\n{@renderScript /}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### output(or something similar, it is not prettified right now)\n```html\n\u003c!doctype html\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cscript\u003e\n\u003c!-- the unused bundles are not included --\u003e\n$script([\"one.js\"],\"one\");\n$script([\"two.js\"],\"two\");\n$script.ready([\"one\",\"two\"], function(){\n  $script([\"three.js\"],\"three\");\n})\n$script.ready([\"two\",\"three\"],function(){\n});\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### helper list\n\nHelper name | Use\n------------ | ----------\nbundleScript | defining script in a bundle\nbundleDepends | defining bundle dependencies\ndependsOn | To be used with \\@scriptjs and \\@bundleDepends for defining script or bundle dependency\nscriptjs | for a block of code encapculated within a $script.ready\nloadBundle | if you want to explicitly load a bundle, for example some global.js kinda things that you wanna load even if it is not depended\nrenderScript | place this at where you want to render the scripts, unfortunately this has to be placed after all the above definitions, so, best right before \u003c/body\u003e\n\n#### \\@bundleScript\n```\n{@bundleScript src=\"src.js\" bundle=\"bundlename\"/}\n\u003c!-- or you can do this --\u003e\n{@bundleScript bundle=\"bundlename\"}\n[\"src1.js\",\"src2.js\"]\n{/bundleScript}\n```\n\n#### \\@dependsOn\n```\n{@dependsOn bundle=\"bundlename\"/}\n```\n\n#### \\@bundleDepends\n```\n{@bundleDepends bundle=\"bundlename\" on=\"bundlename2\"/}\n\u003c!-- or below --\u003e\n{@bundleDepends bundle=\"bundlename\"}\n{@dependsOn bundle=\"bundlename2\"/}\n{@dependsOn bundle=\"bundlename3\"/}\n{/bundleDepends}\n```\n\n#### \\@scriptjs\n```\n{@scriptjs dependsOn=\"bundlename2\"}\nconsole.log('abc');\nsomecodeyouwannado();\n//basically all your javascript code that depends on bundlename2\n{/scriptjs}\n\u003c!-- or below --\u003e\n{@scriptjs}\n{@dependsOn bundle=\"bundlename2\"/}\n{@dependsOn bundle=\"bundlename3\"/}\nconsole.log('abc');\nsomecodeyouwannado();\n//basically all your javascript code that depends on bundlename2 and bundlename3\n{/scriptjs}\n```\n\n#### \\@loadBundle\n```\n{@loadBundle bundle=\"bundle\"/}\n```\n#### \\@renderScript\n```\n{@renderScript/}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekhei%2Fdust-scriptjs-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshekhei%2Fdust-scriptjs-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekhei%2Fdust-scriptjs-helper/lists"}