CodeSampleX

샘플

process-nextick-args 2.0.1: process-nextick-args

검증된 샘플 — npm process-nextick-args 2.0.1: process-nextick-args. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: nextTick schedules callback…

sha256:d14679bc22210e1e45a3a63387344cff2f98d953a4fa8bf0398af022720c7aa0

이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다. 통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다. MIT-0

실행 증거

선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.

증거 기준
서명된 컨트랙트 통과
검증 영수증
1
빌드한 서명 키
1
선언된 환경 linux 24 · ubuntu · glibc 2.39 x64 npm

검증 실행 환경

환경 컨트랙트 단계 실행일
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-29

케이스

HOW
목표
verify process-nextick-args in pkg:npm/process-nextick-args@2.0.1
패키지
심벌
  • process-nextick-args
생성일
2026-08-29T05:39:32Z

컨트랙트

  1. nextTick schedules callback execution asynchronously on next tick
  2. nextTick passes a single argument to the callback
  3. nextTick passes multiple arguments to the callback
  4. nextTick passes four or more arguments to the callback
  5. nextTick preserves callback execution order FIFO
  6. nextTick throws TypeError when callback is not a function

파일

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

소스 아티팩트 내려받기 (tar.gz)

소스

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 process-nextick-args in pkg:npm/process-nextick-args@2.0.1
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/process-nextick-args@2.0.1
Demonstrate these symbols/APIs:
  - process-nextick-args

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:b7007530d82c4f431b78426b536cd56248c13e5b327af6a367a251f4077d54c3","contract":["nextTick schedules callback execution asynchronously on next tick","nextTick passes a single argument to the callback","nextTick passes multiple arguments to the callback","nextTick passes four or more arguments to the callback","nextTick preserves callback execution order FIFO","nextTick throws TypeError when callback is not a function"],"goal":"verify process-nextick-args in pkg:npm/process-nextick-args@2.0.1","kind":"HOW","packages":["pkg:npm/process-nextick-args@2.0.1"],"schemaVersion":1,"symbols":["process-nextick-args"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/process-nextick-args@2.0.1"],"schemaVersion":1,"subject":"pkg:npm/process-nextick-args@2.0.1","symbols":["process-nextick-args"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "process-nextick-args-verification",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "process-nextick-args-verification",
      "version": "1.0.0",
      "dependencies": {
        "process-nextick-args": "2.0.1"
      }
    },
    "node_modules/process-nextick-args": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "process-nextick-args-verification",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification for process-nextick-args",
  "type": "module",
  "dependencies": {
    "process-nextick-args": "2.0.1"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify process-nextick-args in pkg:npm/process-nextick-args@2.0.1",
  "kind": "HOW",
  "packages": [
    "pkg:npm/process-nextick-args@2.0.1"
  ],
  "symbols": [
    "process-nextick-args"
  ]
}
test/contract.mjs
import assert from 'node:assert';
import pna from 'process-nextick-args';

function waitTicks(count = 1) {
  return new Promise((resolve) => {
    let remaining = count;
    function next() {
      if (--remaining <= 0) {
        resolve();
      } else {
        pna.nextTick(next);
      }
    }
    pna.nextTick(next);
  });
}

// 1. nextTick schedules callback execution asynchronously on next tick
let called = false;
pna.nextTick(() => {
  called = true;
});
assert.strictEqual(called, false);
await waitTicks(1);
assert.strictEqual(called, true);

// 2. nextTick passes a single argument to the callback
let receivedSingle = null;
pna.nextTick((val) => {
  receivedSingle = val;
}, 'hello');
await waitTicks(1);
assert.strictEqual(receivedSingle, 'hello');

// 3. nextTick passes multiple arguments to the callback
let receivedMultiple = null;
pna.nextTick((a, b, c) => {
  receivedMultiple = [a, b, c];
}, 1, 'two', { key: 'value' });
await waitTicks(1);
assert.deepStrictEqual(receivedMultiple, [1, 'two', { key: 'value' }]);

// 4. nextTick passes four or more arguments to the callback
let receivedMany = null;
pna.nextTick((a, b, c, d, e) => {
  receivedMany = [a, b, c, d, e];
}, 10, 20, 30, 40, 50);
await waitTicks(1);
assert.deepStrictEqual(receivedMany, [10, 20, 30, 40, 50]);

// 5. nextTick preserves callback execution order FIFO
const order = [];
pna.nextTick(() => order.push(1));
pna.nextTick(() => order.push(2));
pna.nextTick(() => order.push(3));
await waitTicks(1);
assert.deepStrictEqual(order, [1, 2, 3]);

// 6. nextTick throws TypeError when callback is not a function
assert.throws(
  () => pna.nextTick(null),
  {
    name: 'TypeError'
  }
);
assert.throws(
  () => pna.nextTick('not-a-fn'),
  {
    name: 'TypeError'
  }
);

console.log('Contract passed');

오리진 시더

익명