Last active
September 15, 2025 17:50
-
-
Save jonchurch/9f9283e77b4937c8879448582bcd09ae to your computer and use it in GitHub Desktop.
Which npm package has the largest version number? with Google BigQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Largest single semver component seen for npm packages | |
WITH parsed AS ( | |
SELECT | |
Name, | |
Version, | |
SAFE_CAST(REGEXP_EXTRACT(Version, r'^(\d+)') AS INT64) AS major, | |
SAFE_CAST(REGEXP_EXTRACT(Version, r'^\d+\.(\d+)') AS INT64) AS minor, | |
SAFE_CAST(REGEXP_EXTRACT(Version, r'^\d+\.\d+\.(\d+)') AS INT64) AS patch | |
FROM `bigquery-public-data.deps_dev_v1.PackageVersionsLatest` | |
WHERE System = 'NPM' | |
), | |
semver_only AS ( | |
SELECT * | |
FROM parsed | |
WHERE major IS NOT NULL AND minor IS NOT NULL AND patch IS NOT NULL | |
), | |
per_pkg AS ( | |
SELECT | |
Name, | |
MAX(GREATEST(major, minor, patch)) AS largest_component, | |
ARRAY_AGG( | |
STRUCT(Version, major, minor, patch) | |
ORDER BY GREATEST(major,minor,patch) DESC, major DESC, minor DESC, patch DESC, Version DESC | |
LIMIT 1 | |
)[OFFSET(0)] AS example | |
FROM semver_only | |
GROUP BY Name | |
), | |
semver_counts AS ( | |
SELECT Name, COUNT(*) AS semver_version_count | |
FROM semver_only | |
GROUP BY Name | |
) | |
SELECT | |
p.Name, | |
p.largest_component, | |
p.example.Version AS example_version | |
FROM per_pkg p | |
JOIN semver_counts c USING (Name) | |
WHERE c.semver_version_count >= p.largest_component | |
ORDER BY p.largest_component DESC | |
LIMIT 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | largest_component | example_version | |
---|---|---|---|
@mahdiarjangi/phetch-cli | 19494 | 1.0.19494 | |
electron-remote-control | 19065 | 1.2.19065 | |
@quip/collab | 16999 | 1.16999.0 | |
@atlassian-test-prod/hello-world | 16707 | 9.7.16707 | |
@wix/wix-code-types | 14717 | 2.0.14717 | |
@octopusdeploy/design-system-components | 14257 | 2025.3.14257 | |
@octopusdeploy/design-system-tokens | 14257 | 2025.3.14257 | |
@octopusdeploy/type-utils | 14257 | 2025.3.14257 | |
@atlassian-test-staging/test | 13214 | 49.4.13214 | |
binky | 9906 | 3.4.9906 | |
carrot-scan | 9809 | 5.0.9809 | |
terrapin-test-1 | 8151 | 1.0.8151 | |
@prisma/language-server | 7895 | 31.0.7895 | |
@omnia/tooling-vue | 6012 | 0.6012.0-prod | |
@omnia/runtime | 6012 | 0.6012.0-prod | |
@omnia/fx-sp | 6012 | 0.6012.0-prod | |
@omnia/tooling-composers | 6012 | 0.6012.0-prod | |
kse-visilia | 5997 | 1.6.5997 | |
fsweb-publish-test | 5522 | 1.5522.0 | |
intraactive-sdk-ui | 4748 | 1.1.4748 | |
@idxdb/promised | 4614 | 2.3.4614 | |
wix-style-react | 4264 | 1.1.4264 | |
sale-client | 4111 | 3.1.4111-zk | |
botfather | 4058 | 3.6.4058 | |
all-the-package-names | 3905 | 1.3905.0 | |
@openactive/rpde-validator | 3571 | 3.0.3571 | |
electron-i18n | 3136 | 1.3136.0 | |
warframe-items | 3060 | 1.1253.3060 | |
ebt-vue | 3037 | 1.55.3037 | |
@geometryzen/jsxgraph | 3022 | 1.6.3022 | |
eslint-config-innovorder-v2 | 2729 | 2.2729.2 | |
@innovorder/serverless-resize-bucket-images | 2729 | 2.2729.2 | |
@deriv/api-types | 2642 | 1.0.2642 | |
react-native-navigation | 2641 | 2.0.2641 | |
@zuplo/runtime | 2544 | 5.2544.0 | |
@zuplo/core | 2544 | 5.2544.0 | |
membership-tpa-translations | 2515 | 1.0.2515 | |
@stoplight/cli | 2399 | 6.0.2399 | |
all-the-package-repos | 2390 | 2.0.2390 | |
@xuda.io/xuda-worker-bundle | 2366 | 1.3.2366 | |
react-module-container | 2356 | 1.0.2356 | |
@abtasty/pulsar-common-ui | 2314 | 1.1.2314 | |
@xuda.io/xuda-worker-bundle-min | 2256 | 1.3.2256 | |
react-home-ar | 2195 | 0.0.2195 | |
@wppconnect/wa-version | 2178 | 1.5.2178 | |
@parative/library | 2145 | 3.4.2145 | |
@pitcher/canvas-ui | 2025 | 2025.9.8-94050 | |
@lightdash/warehouses | 1987 | 0.1987.0 | |
@lightdash/cli | 1987 | 0.1987.0 | |
@lightdash/common | 1987 | 0.1987.0 | |
@eigenspace/framer-bundle-minifier | 1930 | 0.0.1930 | |
carpams | 1919 | 1.1.1919 | |
@eth-optimism/tokenlist | 1714 | 10.0.1714 | |
aws-sdk | 1692 | 2.1692.0 | |
hypothesis | 1688 | 1.1688.0 | |
ros.grant.common | 1681 | 2.0.1681 | |
commons-validator-js | 1669 | 1.0.1669 | |
mol_regexp | 1627 | 0.0.1627 | |
mol_crypto_lib | 1607 | 0.1.1607 | |
@weather-cloud/lcu-sln-weather-cloud | 1600 | 0.4.1600-integration | |
@weather-cloud/lcu-el-departure-table | 1600 | 0.4.1600-integration | |
@weather-cloud/lcu-el-wc-search-form | 1600 | 0.4.1600-integration | |
@weather-cloud/common | 1600 | 0.4.1600-integration | |
weboptimizer | 1600 | 2.0.1600 | |
@weather-cloud/lcu-el-wc-route-map | 1600 | 0.4.1600-integration | |
@nuxt/webpack-builder-nightly | 1593 | 3.14.1593-28877286.e14bf443 | |
@nuxt/kit-nightly | 1593 | 3.14.1593-28877286.e14bf443 | |
@nuxt/vite-builder-nightly | 1593 | 3.14.1593-28877286.e14bf443 | |
nuxt-nightly | 1593 | 3.14.1593-28877286.e14bf443 | |
@nuxt/schema-nightly | 1593 | 3.14.1593-28877286.e14bf443 | |
mol_data_all | 1576 | 1.1.1576 | |
@teambit/variants | 1539 | 0.0.1539 | |
pinokiod | 1536 | 3.8.1536 | |
mol_db | 1532 | 0.0.1532 | |
mol_wire_lib | 1524 | 1.0.1524 | |
mol_wire_dom | 1506 | 0.0.1506 | |
@socialgouv/fiches-vdd-types | 1497 | 2.1497.0 | |
@socialgouv/fiches-vdd | 1497 | 2.1497.0 | |
mol_plot_all | 1497 | 1.2.1497 | |
mol_wire_pub | 1492 | 1.0.1492 | |
@dev-blinq/cucumber_client | 1474 | 1.0.1474-dev | |
mol_time_all | 1466 | 1.1.1466 | |
@pisell/private-materials | 1462 | 1.1.1462 | |
@teambit/config | 1446 | 0.0.1446 | |
user-agents | 1444 | 1.0.1444 | |
cdk-gitlab-runner | 1423 | 1.115.1423 | |
payments | 1404 | 2.0.1404 | |
safecheck-client | 1401 | 1.13.1401 | |
mol_jsx_lib | 1387 | 0.0.1387 | |
wix-art-store-3rd-party | 1382 | 1.0.1382 | |
@teambit/express | 1371 | 0.0.1371 | |
mol_compare_deep | 1366 | 0.0.1366 | |
@teambit/cache | 1365 | 0.0.1365 | |
@teambit/logger | 1365 | 0.0.1365 | |
@lowcodeunit/lcu-map-demo | 1363 | 0.31.1363-integration | |
@lowcodeunit/lcu-map-lcu | 1363 | 0.31.1363-integration | |
@lowcodeunit/lcu-map-common | 1363 | 0.31.1363-integration | |
mol_key | 1350 | 0.0.1350 | |
coveo-interface-editor | 1315 | 1.0.1315 | |
react-native-calendars | 1313 | 1.1313.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment