Registry /
serialization / test-certificate-context
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
context
✓ import context from 'test-certificate-context'
✗ const context = require('test-certificate-context')
Package is ESM-only with a default export. CommonJS require() will fail.
TEST_CERTIFICATE_V1_CONTEXT_URL
✓ import { TEST_CERTIFICATE_V1_CONTEXT_URL } from 'test-certificate-context'
✗ import { TestCertificateV1ContextUrl } from 'test-certificate-context'
Named export is all caps with underscores.
context (CommonJS)
✓ const context = (await import('test-certificate-context')).default
✗ const context = require('test-certificate-context')
CommonJS users must use dynamic import. Package has no default CommonJS export.
Shows how to import and use the context object and URL, then create a W3C Verifiable Credential with medical test context.
import context, { TEST_CERTIFICATE_V1_CONTEXT_URL } from 'test-certificate-context';
console.log('Context URL:', TEST_CERTIFICATE_V1_CONTEXT_URL);
// Context URL: https://www.w3.org/2022/credentials/examples/v1
// Use the context when creating a Verifiable Credential
import { createVerifiableCredentialJwt } from '@transmute/vc.js';
const credential = {
'@context': [
'https://www.w3.org/2018/credentials/v1',
context
],
type: ['VerifiableCredential', 'MedicalTestCertificate'],
issuer: process.env.ISSUER_DID ?? 'did:example:123',
issuanceDate: new Date().toISOString(),
credentialSubject: {
id: 'did:example:subject',
testResult: 'negative'
}
};
console.log('Credential context set:', JSON.stringify(credential['@context'], null, 2));
Errors
Common errors & fixes
Cannot find module 'test-certificate-context'
Package is ESM-only and cannot be required with require().
fixUse dynamic import: const context = await import('test-certificate-context'); ERR_REQUIRE_ESM: require() of ES Module
Trying to use require() on an ESM-only package.
fixChange to import syntax or use dynamic import.
Unknown variable or property: TEST_CERTIFICATE_V1_CONTEXT_URL
Incorrect case for named import.
fixImport as: import { TEST_CERTIFICATE_V1_CONTEXT_URL } from 'test-certificate-context'; Audit
Dependencies
No dependency data recorded yet.