CodeSampleX

Sample

electron-to-chromium 1.5.402: chromiumVersions

Verified sample for npm electron-to-chromium 1.5.402: chromiumVersions. The contract ran on node 22 · linux alpine/x64 · docker and passed.

sha256:86e3b9b4afcb04fb6376d80b7e169442be3dd72731c3ee81bae1df12987f0c06

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
1
Signing keys that built it
1
Declared environment node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

Verification-run environments

Environment Contract Stages Run
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5…
2026-08-26

Case

HOW
Goal
verify chromiumVersions in pkg:npm/electron-to-chromium@1.5.402
Packages
Symbols
  • chromiumVersions
Environment
node 22.23.2
Created
2026-08-26T14:35:36Z

Contract

  1. chromiumVersions is an object mapping Chromium major version strings to Electron version strings
  2. chromiumVersions maps legacy Chromium major versions to Electron versions
  3. chromiumVersions maps modern Chromium major versions to Electron versions
  4. chromiumVersions returns undefined for unmapped or non-existent Chromium versions
  5. chromiumVersions contains only string keys and string values

Files

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • src/index.js
  • test/contract.js

Download the source artifact (tar.gz)

Source

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify chromiumVersions in pkg:npm/electron-to-chromium@1.5.402
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/electron-to-chromium@1.5.402
Demonstrate these symbols/APIs:
  - chromiumVersions

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:85828db316c97b538aec7aa0970733d7c2e8797c15c47af6499916deaddd0d52","constraints":{"executionContext":"node"},"contract":["chromiumVersions is an object mapping Chromium major version strings to Electron version strings","chromiumVersions maps legacy Chromium major versions to Electron versions","chromiumVersions maps modern Chromium major versions to Electron versions","chromiumVersions returns undefined for unmapped or non-existent Chromium versions","chromiumVersions contains only string keys and string values"],"goal":"verify chromiumVersions in pkg:npm/electron-to-chromium@1.5.402","kind":"HOW","packages":["pkg:npm/electron-to-chromium@1.5.402"],"schemaVersion":1,"symbols":["chromiumVersions"]},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/electron-to-chromium@1.5.402"],"schemaVersion":1,"subject":"pkg:npm/electron-to-chromium@1.5.402","symbols":["chromiumVersions"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-electron-to-chromium-chromium-versions",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-electron-to-chromium-chromium-versions",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "electron-to-chromium": "1.5.402"
      }
    },
    "node_modules/electron-to-chromium": {
      "version": "1.5.402",
      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.402.tgz",
      "integrity": "sha512-/oOpMaPT6Yg+6/1XQhyIPlzgj7Ye9zf+nNM2Uh6OcE2G2oNptWazFa+qB2Pdqqbsc9KnIDzgAntoYN0dbwOXwA==",
      "license": "ISC"
    }
  }
}
package.json
{
  "name": "sample-electron-to-chromium-chromium-versions",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification sample for chromiumVersions in electron-to-chromium",
  "main": "src/index.js",
  "scripts": {
    "test": "node test/contract.js"
  },
  "dependencies": {
    "electron-to-chromium": "1.5.402"
  },
  "license": "MIT-0"
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify chromiumVersions in pkg:npm/electron-to-chromium@1.5.402",
  "kind": "HOW",
  "packages": [
    "pkg:npm/electron-to-chromium@1.5.402"
  ],
  "symbols": [
    "chromiumVersions"
  ]
}
src/index.js
const { chromiumVersions } = require('electron-to-chromium');

/**
 * Looks up the Electron version for a given Chromium major version string.
 * @param {string} chromiumMajor Chromium major version string (e.g. '39', '130')
 * @returns {string|undefined} Electron version string or undefined if not found
 */
function getElectronVersionForChromium(chromiumMajor) {
  if (typeof chromiumMajor !== 'string') {
    return undefined;
  }
  return chromiumVersions[chromiumMajor];
}

module.exports = {
  chromiumVersions,
  getElectronVersionForChromium
};
test/contract.js
const assert = require('node:assert');
const { chromiumVersions, getElectronVersionForChromium } = require('../src/index.js');
const rawEtc = require('electron-to-chromium');

// Verify export matches raw electron-to-chromium export
assert.strictEqual(chromiumVersions, rawEtc.chromiumVersions, 'chromiumVersions should match module export');
assert.strictEqual(typeof chromiumVersions, 'object', 'chromiumVersions must be an object');
assert.ok(chromiumVersions !== null, 'chromiumVersions must not be null');

// 1. chromiumVersions is an object mapping Chromium major version strings to Electron version strings
const keys = Object.keys(chromiumVersions);
assert.ok(keys.length > 50, 'chromiumVersions contains major version mappings');
assert.ok(keys.every(k => typeof k === 'string'), 'all keys in chromiumVersions are string version numbers');
assert.ok(Object.values(chromiumVersions).every(v => typeof v === 'string'), 'all values in chromiumVersions are string version numbers');

// 2. chromiumVersions maps legacy Chromium major versions to Electron versions
assert.strictEqual(chromiumVersions['39'], '0.20', 'chromium 39 maps to electron 0.20');
assert.strictEqual(chromiumVersions['50'], '1.1', 'chromium 50 maps to electron 1.1');
assert.strictEqual(chromiumVersions['53'], '1.4', 'chromium 53 maps to electron 1.4');
assert.strictEqual(getElectronVersionForChromium('39'), '0.20', 'helper getElectronVersionForChromium resolves 39');
assert.strictEqual(getElectronVersionForChromium('53'), '1.4', 'helper getElectronVersionForChromium resolves 53');

// 3. chromiumVersions maps modern Chromium major versions to Electron versions
assert.strictEqual(chromiumVersions['85'], '10.0', 'chromium 85 maps to electron 10.0');
assert.strictEqual(chromiumVersions['104'], '20.0', 'chromium 104 maps to electron 20.0');
assert.strictEqual(chromiumVersions['124'], '30.0', 'chromium 124 maps to electron 30.0');
assert.strictEqual(chromiumVersions['130'], '33.0', 'chromium 130 maps to electron 33.0');
assert.strictEqual(chromiumVersions['132'], '34.0', 'chromium 132 maps to electron 34.0');
assert.strictEqual(getElectronVersionForChromium('130'), '33.0', 'helper getElectronVersionForChromium resolves 130');

// 4. chromiumVersions returns undefined for unmapped or non-existent Chromium versions
assert.strictEqual(chromiumVersions['9999'], undefined, 'non-existent version returns undefined');
assert.strictEqual(chromiumVersions['invalid-version'], undefined, 'invalid version key returns undefined');
assert.strictEqual(getElectronVersionForChromium('9999'), undefined, 'helper returns undefined for non-existent version');
assert.strictEqual(getElectronVersionForChromium(null), undefined, 'helper returns undefined for non-string input');
assert.strictEqual(getElectronVersionForChromium(130), undefined, 'helper returns undefined for numeric input');

console.log('Contract tests passed successfully.');

Origin Seeder

anonymous