{"id":15118451,"url":"https://github.com/Badisi/latest-version","last_synced_at":"2025-09-28T00:32:41.006Z","repository":{"id":57100143,"uuid":"355265452","full_name":"Badisi/latest-version","owner":"Badisi","description":"📦  Get latest versions of packages","archived":false,"fork":false,"pushed_at":"2025-06-30T06:15:00.000Z","size":1172,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T15:58:36.108Z","etag":null,"topics":["check","current","dependencies","latest","module","next","npm","package","package-json","pkg","updates","version"],"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/Badisi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2021-04-06T16:54:44.000Z","updated_at":"2025-06-29T21:25:37.000Z","dependencies_parsed_at":"2023-02-15T15:35:30.408Z","dependency_job_id":"f93baf7c-9125-440e-9cfa-ab93a693d335","html_url":"https://github.com/Badisi/latest-version","commit_stats":{"total_commits":175,"total_committers":1,"mean_commits":175.0,"dds":0.0,"last_synced_commit":"49c0cb7f028fdad334540e8b7ceb251b830f4f37"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/Badisi/latest-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Flatest-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Flatest-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Flatest-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Flatest-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Badisi","download_url":"https://codeload.github.com/Badisi/latest-version/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Badisi%2Flatest-version/sbom","scorecard":{"id":19847,"data":{"date":"2025-08-11","repo":{"name":"github.com/Badisi/latest-version","commit":"045fa696fa00877cad6803d2ea7d8b6b763c8904"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/28 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":"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":"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_release.yml:1","Warn: no topLevel permission defined: .github/workflows/ci_tests.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":"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":"Maintained","score":4,"reason":"5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci_release.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/Badisi/latest-version/ci_release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci_tests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/Badisi/latest-version/ci_tests.yml/main?enable=pin","Info:   0 out of   2 third-party GitHubAction 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":"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":"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":"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":"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":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7"],"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-14T16:32:44.743Z","repository_id":57100143,"created_at":"2025-08-14T16:32:44.743Z","updated_at":"2025-08-14T16:32:44.743Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277311261,"owners_count":25796890,"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-27T02:00:08.978Z","response_time":73,"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":["check","current","dependencies","latest","module","next","npm","package","package-json","pkg","updates","version"],"created_at":"2024-09-26T01:46:16.261Z","updated_at":"2025-09-28T00:32:40.692Z","avatar_url":"https://github.com/Badisi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    @badisi/latest-version\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ci\u003e📦 Get latest versions of packages.\u003c/i\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@badisi/latest-version\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/v/@badisi/latest-version.svg?color=blue\u0026logo=npm\" alt=\"npm version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://npmcharts.com/compare/@badisi/latest-version?minimal=true\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/dw/@badisi/latest-version.svg?color=7986CB\u0026logo=npm\" alt=\"npm donwloads\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/badisi/latest-version/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/l/@badisi/latest-version.svg?color=ff69b4\" alt=\"license\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Badisi/latest-version/actions/workflows/ci_tests.yml\"\u003e\n        \u003cimg src=\"https://github.com/Badisi/latest-version/actions/workflows/ci_tests.yml/badge.svg\" alt=\"build status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/badisi/latest-version/blob/main/CONTRIBUTING.md#-submitting-a-pull-request-pr\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n## Features\n\n✅ Get `installed` versions of packages *(if installed locally or globally with npm or yarn)*\u003cbr/\u003e\n✅ Get `latest` and `next` versions of packages *(from package registries)*\u003cbr/\u003e\n✅ Get `wanted` version of packages *(if a version range or a tag is provided)*\u003cbr/\u003e\n✅ Check if any `updates` are available\u003cbr/\u003e\n✅ Cache support to increase data retrieval performance\u003cbr/\u003e\n✅ Support public/private repositories and proxies\u003cbr/\u003e\n✅ [Command line tool](#command-line-tool) that helps visualize packages updates\u003cbr/\u003e\n\n## Installation\n\n```sh\nnpm install @badisi/latest-version --save\n```\n\n```sh\nyarn add @badisi/latest-version\n```\n\n## Usage\n\n__Example__\n\n```ts\n/** CommonJS */\n// const { readFileSync } = require('fs');\n// const latestVersion = require('@badisi/latest-version');\n\n/** ESM / Typescript */\nimport { readFileSync } from 'fs';\nimport latestVersion from '@badisi/latest-version';\n\n(async () =\u003e {\n    // Single package\n    const pkg = await latestVersion('npm');\n\n    // List of packages\n    const pkgs = await latestVersion(['npm', 'npm@1.3.2', 'npm@beta', '@scope/name@^5.0.2']);\n\n    // Package.json\n    const pkgs = await latestVersion(JSON.parse(readFileSync('package.json').toString()));\n\n    // Using cache\n    const pkg = await latestVersion('npm@^5.0.2', { useCache: true });\n})();\n```\n\n__Return__\n\nEither a collection or a single `LatestVersionPackage` object:\n\n```ts\ninterface LatestVersionPackage {\n    /**\n     * The name of the package.\n     */\n    name: string;\n    /**\n     * The current local installed version of the package (if installed).\n     */\n    local?: string;\n    /**\n     * The current npm global installed version of the package (if installed).\n     */\n    globalNpm?: string;\n    /**\n     * The current yarn global installed version of the package (if installed).\n     */\n    globalYarn?: string;\n    /**\n     * The latest version of the package found on the registry (if found).\n     */\n    latest?: string;\n    /**\n     * The next version of the package found on the registry (if found).\n     */\n    next?: string;\n    /**\n     * The tag or version range that was provided (if provided).\n     *\n     * @default \"latest\"\n     */\n    wantedTagOrRange?: string;\n    /**\n     * The latest version of the package found on the registry and satisfied by the wanted tag or version range.\n     */\n    wanted?: string;\n    /**\n     * Whether the local or global installed versions (if any) could be upgraded or not, based on the wanted version.\n     */\n    updatesAvailable: {\n        local: string | false;\n        globalNpm: string | false;\n        globalYarn: string | false;\n    } | false;\n    /**\n     * Any error that might have occurred during the process.\n     */\n    error?: Error;\n}\n```\n\n__Options__\n\n```ts\ninterface LatestVersionOptions {\n    /**\n     * Awaiting the api to return might take time, depending on the network, and might impact your package loading performance.\n     * You can use the cache mechanism to improve load performance and reduce unnecessary network requests.\n     * If `useCache` is not supplied, the api will always check for updates and wait for every requests to return before returning itself.\n     * If `useCache` is used, the api will either (for each provided packages):\n     * 1) return immediately if a cache was found.\n     * 2) fetch and wait for updates of that particular package then creates a cache for it so that it is available for the next call to the api.\n     *\n     * @default false\n     */\n    useCache?: boolean;\n\n    /**\n     * How long the cache for each provided packages should be used before being refreshed (in milliseconds).\n     * If `useCache` is not supplied, this option has no effect.\n     * If `0` is used, this will force the cache to refresh immediately:\n     * 1) New updates will be fetched and waited\n     * 2) The cache for each provided packages will be refreshed and made available for the next call to the api\n     *\n     * @default ONE_DAY\n     */\n    cacheMaxAge?: number;\n\n    /**\n     * A JavaScript package registry url that implements the CommonJS Package Registry specification.\n     *\n     * @default \"Looks at any registry urls in the .npmrc file or fallback to the default npm registry instead\"\n     * @example \u003ccaption\u003e.npmrc\u003c/caption\u003e\n     * registry = 'https://custom-registry.com/'\n     * @pkgscope:registry = 'https://custom-registry.com/'\n     */\n    registryUrl?: string;\n\n    /**\n     * Set of options to be passed down to Node.js http/https request.\n     *\n     * @example \u003ccaption\u003eBehind a proxy with self-signed certificate\u003c/caption\u003e\n     * { ca: fs.readFileSync('proxy-cert.pem') }\n     * @example \u003ccaption\u003eBypassing certificate validation\u003c/caption\u003e\n     * { rejectUnauthorized: false }\n     */\n    requestOptions?: RequestOptions;\n}\n```\n\n\n## Command line tool\n\nThe CLI utility will help you visualize any available updates for a given *package.json* file, a local *package.json* file or any provided package names.\n\n```sh\n$ latest-version \u003cpackageJson|packageName...\u003e\n\n  Examples:\n    $ lv\n    $ latest-version path/to/package.json\n    $ latest-version package1 package2 package3 --skip-missing\n```\n\n![CLI utility preview][clipreview]\n\n\n\n## Development\n\nSee the [developer docs][developer].\n\n\n## Contributing\n\n#### \u003e Want to Help ?\n\nWant to file a bug, contribute some code or improve documentation ? Excellent!\n\nBut please read up first on the guidelines for [contributing][contributing], and learn about submission process, coding rules and more.\n\n#### \u003e Code of Conduct\n\nPlease read and follow the [Code of Conduct][codeofconduct] and help me keep this project open and inclusive.\n\n\n\n\n[clipreview]: https://github.com/badisi/latest-version/blob/main/cli_preview.png\n[developer]: https://github.com/badisi/latest-version/blob/main/DEVELOPER.md\n[contributing]: https://github.com/badisi/latest-version/blob/main/CONTRIBUTING.md\n[codeofconduct]: https://github.com/badisi/latest-version/blob/main/CODE_OF_CONDUCT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBadisi%2Flatest-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBadisi%2Flatest-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBadisi%2Flatest-version/lists"}