{"id":19664883,"url":"https://github.com/small-tech/import-fresh","last_synced_at":"2026-06-17T09:32:08.958Z","repository":{"id":117560693,"uuid":"341171245","full_name":"small-tech/import-fresh","owner":"small-tech","description":"Import a fresh, uncached, version of an EcmaScript Module (ESM; aka ES6 module/JavaScript Module).","archived":false,"fork":false,"pushed_at":"2021-02-23T13:37:55.000Z","size":12,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-22T09:19:52.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/small-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-02-22T11:04:33.000Z","updated_at":"2023-09-03T03:12:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"878ae098-e231-4303-9d43-59964cef14b2","html_url":"https://github.com/small-tech/import-fresh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/small-tech/import-fresh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fimport-fresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fimport-fresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fimport-fresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fimport-fresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/small-tech","download_url":"https://codeload.github.com/small-tech/import-fresh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fimport-fresh/sbom","scorecard":{"id":832299,"data":{"date":"2025-08-11","repo":{"name":"github.com/small-tech/import-fresh","commit":"9a71a465a6a37a348ec66c59d9dd7e12595afcf8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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":"Code-Review","score":0,"reason":"Found 0/5 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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9"],"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-23T18:04:15.482Z","repository_id":117560693,"created_at":"2025-08-23T18:04:15.482Z","updated_at":"2025-08-23T18:04:15.482Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34443232,"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-06-17T02:00:05.408Z","response_time":127,"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-11T16:19:28.941Z","updated_at":"2026-06-17T09:32:08.941Z","avatar_url":"https://github.com/small-tech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @small-tech/import-fresh\n\nImport a fresh, uncached version of an EcmaScript Module (ESM; aka ES6 module/JavaScript Module).\n\n---\n\n___Note:__ This will leak memory and eventually crash your system. [Garbage collecting stale ESM modules is not a solved problem](https://github.com/nodejs/modules/issues/307) as of Feb, 2021. Do not use this in production._\n\n---\n\n## Syntax\n\n```js\nimportFresh(absolutePathToModule)\n```\n\n## Example\n\nIn _module.mjs_:\n\n```js\nexport default (() =\u003e Math.random())\n```\n\nIn _index.mjs_:\n\n```js\nimport path from 'path'\nimport importFresh from '@small-tech/importFresh'\n\nconsole.log((await importFresh(path.resolve('./module.mjs'))).default)\nconsole.log((await importFresh(path.resolve('./module.mjs'))).default)\n```\n\nRun _index.mjs_ and note that you see two different random numbers.\n\n## Do you need this module?\n\nBefore you just `npm install` this, ask yourself if you really need it.\n\nIf you’re only going to use this in one place, you can cache bust using a single line of vanilla JavaScript:\n\ne.g.,\n\n```js\nconst myModule = await import(`./my-module?update=${new Date()}`)\n```\n\n(Bonus: you won’t have to use absolute paths.)\n\nAnd if you want to use it from several places in the same file, you can just make a simple function:\n\n```js\nfunction importFresh(modulePath) {\n  return await import(`${modulePath}?update=${new Date()}`)\n}\n```\n\nThe only time this module really saves you any work is if you need this functionality from multiple files within your project.\n\nSo evaluate whether you need to use it and save a dependency if you don’t.\n\n## Like this? Fund us!\n\n[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit.\n\nWe exist in part thanks to patronage by people like you. If you share [our vision](https://small-tech.org/about/#small-technology) and want to support our work, please [become a patron or donate to us](https://small-tech.org/fund-us) today and help us continue to exist.\n\n## Copyright\n\n\u0026copy; 2021 [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org).\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmall-tech%2Fimport-fresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmall-tech%2Fimport-fresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmall-tech%2Fimport-fresh/lists"}