Beispiel
promzard 2.0.0: Promzard
Verifiziertes Beispiel für npm promzard 2.0.0: Promzard. Der Vertrag lief auf node 22 · linux debian/x64 · docker und bestand.
sha256:ee11454aac20b817182cfce2d0f51e91914cee4d89b81d9cbe3060db87826e5e
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 1
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
linux 24 · ubuntu · glibc 2.39 x64 npm
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| 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-10-21 |
Fall
HOW- Ziel
- verify Promzard in pkg:npm/promzard@2.0.0
- Pakete
- Symbole
-
- Promzard
- Erstellt
- 2026-10-21T02:55:55Z
Contract
- promzard default export equals PromZard.promzard and exposes PromZard and fromBuffer
- promzard.fromBuffer(buf, ctx) evaluates a module template buffer with injected context, nested objects, callback functions (cb(null, val)), and zero-arg async functions
- promzard(file, ctx) and new PromZard(file, ctx).load() load and evaluate a CommonJS template file with injected __basename and context variables
- new PromZard(missingFile, ctx, { backupFile }).load() falls back to backupFile when the primary file cannot be read
Dateien
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/fixtures/backup-config.cjs
- src/fixtures/primary-config.cjs
- src/index.mjs
- test/contract.mjs
Quelltext
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 Promzard in pkg:npm/promzard@2.0.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/promzard@2.0.0
Demonstrate these symbols/APIs:
- Promzard
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.
{"case":{"caseId":"case:sha256:ed50887f73741d8f2d192b474f0ed69d7711260b299cccc7bdb9cbeddbd25077","contract":["promzard default export equals PromZard.promzard and exposes PromZard and fromBuffer","promzard.fromBuffer(buf, ctx) evaluates a module template buffer with injected context, nested objects, callback functions (cb(null, val)), and zero-arg async functions","promzard(file, ctx) and new PromZard(file, ctx).load() load and evaluate a CommonJS template file with injected __basename and context variables","new PromZard(missingFile, ctx, { backupFile }).load() falls back to backupFile when the primary file cannot be read"],"goal":"verify Promzard in pkg:npm/promzard@2.0.0","kind":"HOW","packages":["pkg:npm/promzard@2.0.0"],"schemaVersion":1,"symbols":["Promzard"]},"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/promzard@2.0.0"],"schemaVersion":1,"subject":"pkg:npm/promzard@2.0.0","symbols":["Promzard"],"verifierAdapter":"node-typescript@1"}
{
"name": "verify-promzard",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "verify-promzard",
"version": "1.0.0",
"dependencies": {
"promzard": "2.0.0"
}
},
"node_modules/mute-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz",
"integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==",
"license": "ISC",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/promzard": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/promzard/-/promzard-2.0.0.tgz",
"integrity": "sha512-Ncd0vyS2eXGOjchIRg6PVCYKetJYrW1BSbbIo+bKdig61TB6nH2RQNF2uP+qMpsI73L/jURLWojcw8JNIKZ3gg==",
"license": "ISC",
"dependencies": {
"read": "^4.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/read": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/read/-/read-4.1.0.tgz",
"integrity": "sha512-uRfX6K+f+R8OOrYScaM3ixPY4erg69f8DN6pgTvMcA9iRc8iDhwrA4m3Yu8YYKsXJgVvum+m8PkRboZwwuLzYA==",
"license": "ISC",
"dependencies": {
"mute-stream": "^2.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
}
}
}
{
"name": "verify-promzard",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"test": "node test/contract.mjs"
},
"dependencies": {
"promzard": "2.0.0"
}
}
{
"schemaVersion": 1,
"goal": "verify Promzard in pkg:npm/promzard@2.0.0",
"kind": "HOW",
"packages": [
"pkg:npm/promzard@2.0.0"
],
"symbols": [
"Promzard"
]
}
module.exports = {
source: 'backup',
basename: __basename,
asyncValue: async function () {
return 'from-backup:' + (typeof prefix === 'string' ? prefix : 'none')
}
}
module.exports = {
source: 'primary',
basename: __basename,
computed: function (cb) {
cb(null, 'from-primary:' + (typeof prefix === 'string' ? prefix : 'none'))
}
}
import promzard from 'promzard'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'node:path'
const __dirname = dirname(fileURLToPath(import.meta.url))
export const Promzard = promzard.PromZard
export async function evaluateBuffer(source, context = {}) {
const buf = Buffer.isBuffer(source) ? source : Buffer.from(source, 'utf8')
return promzard.fromBuffer(buf, { ...context })
}
export async function evaluateFileWithBackup(primaryPath, backupPath, context = {}) {
const pz = new Promzard(primaryPath, { ...context }, { backupFile: backupPath })
return pz.load()
}
export function getFixturePaths() {
return {
primary: join(__dirname, 'fixtures', 'primary-config.cjs'),
missing: join(__dirname, 'fixtures', 'missing-config.cjs'),
backup: join(__dirname, 'fixtures', 'backup-config.cjs')
}
}
import assert from 'node:assert/strict'
import promzard from 'promzard'
import { Promzard, evaluateBuffer, evaluateFileWithBackup, getFixturePaths } from '../src/index.mjs'
// 1. Verify default export is PromZard.promzard and static helpers exist
assert.equal(typeof promzard, 'function')
assert.equal(typeof promzard.fromBuffer, 'function')
assert.equal(typeof promzard.PromZard, 'function')
assert.equal(Promzard, promzard.PromZard)
assert.equal(promzard, Promzard.promzard)
// 2. Verify fromBuffer evaluates template buffer with context, nested objects, callback & async functions
const bufferResult = await evaluateBuffer(
`
module.exports = {
appName: appName,
nested: {
port: function (cb) {
cb(null, basePort + 80)
},
tag: async function () {
return this.appName + '-v1'
}
}
}
`,
{ appName: 'demo-service', basePort: 8000 }
)
assert.deepEqual(bufferResult, {
appName: 'demo-service',
nested: {
port: 8080,
tag: 'demo-service-v1'
}
})
// 3. Verify Promzard loads an existing primary file directly via promzard(file, ctx) and new PromZard(file, ctx).load()
const fixtures = getFixturePaths()
const primaryResult = await promzard(fixtures.primary, { prefix: 'ok' })
assert.deepEqual(primaryResult, {
source: 'primary',
basename: 'primary-config.cjs',
computed: 'from-primary:ok'
})
const instanceResult = await new Promzard(fixtures.primary, { prefix: 'inst' }).load()
assert.deepEqual(instanceResult, {
source: 'primary',
basename: 'primary-config.cjs',
computed: 'from-primary:inst'
})
// 4. Verify Promzard falls back to options.backupFile when the primary file does not exist
const backupResult = await evaluateFileWithBackup(fixtures.missing, fixtures.backup, { prefix: 'fallback' })
assert.deepEqual(backupResult, {
source: 'backup',
basename: 'backup-config.cjs',
asyncValue: 'from-backup:fallback'
})
Ursprungs-Seeder
anonym