CodeSampleX

Sample

electron-to-chromium 1.5.411

Verified sample for npm electron-to-chromium 1.5.411. The contract ran on node 22 · linux alpine/x64 · docker and passed: electronToChromium maps major and…

sha256:3d18d13154ad38327e47fac212bc5c8c801b61b168a93781d68111f669f6f4c6

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
2
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-25
node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-09-07

Case

HOW
Goal
verify pkg:npm/electron-to-chromium@1.5.411
Packages
Environment
node 22.23.2
Created
2026-08-25T02:33:26Z

Contract

  1. electronToChromium maps major and full Electron versions to Chromium versions
  2. chromiumToElectron maps major Chromium versions to Electron strings and full versions to arrays
  3. electronToBrowserList produces Browserslist query strings for Electron versions
  4. versions and fullVersions dictionaries map Electron versions to Chromium versions
  5. chromiumVersions and fullChromiumVersions dictionaries map Chromium versions to Electron versions

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 pkg:npm/electron-to-chromium@1.5.411
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/electron-to-chromium@1.5.411
Constraints:
  - executionContext: node
Required runtime conditions:
  - ecosystem: npm
  - language: javascript
  - moduleSystem: cjs
  - packageManager: npm@10.9.8
  - runtime: node@22.23.2

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:fe648a5efb0332a8b65cf16606d85d6ee6eb3e46e7e55243c613eaf865ff49a2","constraints":{"executionContext":"node"},"contract":["electronToChromium maps major and full Electron versions to Chromium versions","chromiumToElectron maps major Chromium versions to Electron strings and full versions to arrays","electronToBrowserList produces Browserslist query strings for Electron versions","versions and fullVersions dictionaries map Electron versions to Chromium versions","chromiumVersions and fullChromiumVersions dictionaries map Chromium versions to Electron versions"],"goal":"verify pkg:npm/electron-to-chromium@1.5.411","kind":"HOW","packages":["pkg:npm/electron-to-chromium@1.5.411"],"schemaVersion":1},"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.411"],"schemaVersion":1,"subject":"pkg:npm/electron-to-chromium@1.5.411","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "electron-to-chromium-sample",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "electron-to-chromium-sample",
      "version": "1.0.0",
      "dependencies": {
        "electron-to-chromium": "1.5.411"
      }
    },
    "node_modules/electron-to-chromium": {
      "version": "1.5.411",
      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.411.tgz",
      "integrity": "sha512-gglkxzokjHfawpGxq75XdBV2/l3BAPzrsMs70qgaZdTW5rpV1tC4MdgJVP9fN126bODA4ZJQkn1wryEzJyQXIg==",
      "license": "ISC"
    }
  }
}
package.json
{
  "name": "electron-to-chromium-sample",
  "version": "1.0.0",
  "dependencies": {
    "electron-to-chromium": "1.5.411"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/electron-to-chromium@1.5.411",
  "kind": "HOW",
  "packages": [
    "pkg:npm/electron-to-chromium@1.5.411"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
src/index.js
const {
  electronToChromium,
  chromiumToElectron,
  electronToBrowserList,
  versions,
  fullVersions,
  chromiumVersions,
  fullChromiumVersions,
} = require('electron-to-chromium');

/**
 * Returns the Chromium version corresponding to a given Electron version.
 *
 * @param {string|number} query - Major or full Electron version.
 * @returns {string|undefined} - Major or full Chromium version string, or undefined.
 */
function getChromiumVersion(query) {
  return electronToChromium(query);
}

/**
 * Returns the Electron version(s) corresponding to a given Chromium version.
 *
 * @param {string|number} query - Major or full Chromium version.
 * @returns {string|string[]|undefined} - Major Electron version, array of full Electron versions, or undefined.
 */
function getElectronVersion(query) {
  return chromiumToElectron(query);
}

/**
 * Returns a Browserslist query string matching the given Electron version.
 *
 * @param {string|number} query - Major Electron version.
 * @returns {string|undefined} - Browserslist query string or undefined.
 */
function getBrowserListQuery(query) {
  return electronToBrowserList(query);
}

/**
 * Returns the mapping of major Electron versions to major Chromium versions.
 *
 * @returns {Record<string, string>}
 */
function getMajorVersionsMap() {
  return versions;
}

/**
 * Returns the mapping of full Electron versions to full Chromium versions.
 *
 * @returns {Record<string, string>}
 */
function getFullVersionsMap() {
  return fullVersions;
}

/**
 * Returns the mapping of major Chromium versions to major Electron versions.
 *
 * @returns {Record<string, string>}
 */
function getChromiumMajorVersionsMap() {
  return chromiumVersions;
}

/**
 * Returns the mapping of full Chromium versions to arrays of full Electron versions.
 *
 * @returns {Record<string, string[]>}
 */
function getChromiumFullVersionsMap() {
  return fullChromiumVersions;
}

module.exports = {
  getChromiumVersion,
  getElectronVersion,
  getBrowserListQuery,
  getMajorVersionsMap,
  getFullVersionsMap,
  getChromiumMajorVersionsMap,
  getChromiumFullVersionsMap,
  electronToChromium,
  chromiumToElectron,
  electronToBrowserList,
  versions,
  fullVersions,
  chromiumVersions,
  fullChromiumVersions,
};
test/contract.js
const assert = require('node:assert/strict');
const {
  getChromiumVersion,
  getElectronVersion,
  getBrowserListQuery,
  getMajorVersionsMap,
  getFullVersionsMap,
  getChromiumMajorVersionsMap,
  getChromiumFullVersionsMap,
} = require('../src/index.js');

async function main() {
  // Contract 1: electronToChromium maps major and full Electron versions to Chromium versions
  {
    assert.strictEqual(getChromiumVersion('1.4'), '53');
    assert.strictEqual(getChromiumVersion('1.4.11'), '53.0.2785.143');
    assert.strictEqual(getChromiumVersion(1), '49');
    assert.strictEqual(getChromiumVersion('9999.0.0'), undefined);
  }

  // Contract 2: chromiumToElectron maps major Chromium versions to Electron strings and full versions to arrays
  {
    assert.strictEqual(getElectronVersion('54'), '1.4');
    assert.deepStrictEqual(getElectronVersion('54.0.2840.101'), ['1.5.0', '1.5.1']);
    assert.strictEqual(getElectronVersion('9999'), undefined);
  }

  // Contract 3: electronToBrowserList produces Browserslist query strings for Electron versions
  {
    assert.strictEqual(getBrowserListQuery('1.4'), 'Chrome >= 53');
    assert.strictEqual(getBrowserListQuery('9999'), undefined);
  }

  // Contract 4: versions and fullVersions dictionaries map Electron versions to Chromium versions
  {
    const majorMap = getMajorVersionsMap();
    assert.strictEqual(typeof majorMap, 'object');
    assert.strictEqual(majorMap['1.4'], '53');

    const fullMap = getFullVersionsMap();
    assert.strictEqual(typeof fullMap, 'object');
    assert.strictEqual(fullMap['1.4.11'], '53.0.2785.143');
  }

  // Contract 5: chromiumVersions and fullChromiumVersions dictionaries map Chromium versions to Electron versions
  {
    const majorChromiumMap = getChromiumMajorVersionsMap();
    assert.strictEqual(typeof majorChromiumMap, 'object');
    assert.strictEqual(majorChromiumMap['54'], '1.4');

    const fullChromiumMap = getChromiumFullVersionsMap();
    assert.strictEqual(typeof fullChromiumMap, 'object');
    assert.strictEqual(Array.isArray(fullChromiumMap['54.0.2840.101']), true);
    assert.deepStrictEqual(fullChromiumMap['54.0.2840.101'], ['1.5.0', '1.5.1']);
  }

  console.log('All pkg:npm/electron-to-chromium@1.5.411 contracts passed successfully.');
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

Origin Seeder

anonymous