샘플
env-paths 2.2.1
검증된 샘플 — npm env-paths 2.2.1. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: Calling envPaths returns standard XDG paths on Linux including data…
sha256:7cb9d06d647edb45d2d6256d62cd9eb6300e3012c4d1381b32686b718aefc8ef
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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-23 |
케이스
HOW- 목표
- verify pkg:npm/env-paths@2.2.1
- 패키지
- 생성일
- 2026-08-23T13:29:34Z
컨트랙트
- Calling envPaths returns standard XDG paths on Linux including data, config, cache, log, and temp directories
- Calling envPaths with default options appends the '-nodejs' suffix to the application directory name
- Setting suffix option to false disables the suffix and uses the bare application name
- Setting suffix option to a custom string appends the custom suffix to the application directory name
- Passing a non-string name argument throws a TypeError
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
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/env-paths@2.2.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/env-paths@2.2.1
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:c192eef179b812cd173899e4a6bd06e84ba93d356d0e04567b3940e01200b438","contract":["Calling envPaths returns standard XDG paths on Linux including data, config, cache, log, and temp directories","Calling envPaths with default options appends the '-nodejs' suffix to the application directory name","Setting suffix option to false disables the suffix and uses the bare application name","Setting suffix option to a custom string appends the custom suffix to the application directory name","Passing a non-string name argument throws a TypeError"],"goal":"verify pkg:npm/env-paths@2.2.1","kind":"HOW","packages":["pkg:npm/env-paths@2.2.1"],"schemaVersion":1},"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/env-paths@2.2.1"],"schemaVersion":1,"subject":"pkg:npm/env-paths@2.2.1","verifierAdapter":"node-typescript@1"}
{
"name": "sample-env-paths",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-env-paths",
"version": "1.0.0",
"dependencies": {
"env-paths": "2.2.1"
}
},
"node_modules/env-paths": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
"integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
"license": "MIT",
"engines": {
"node": ">=6"
}
}
}
}
{
"name": "sample-env-paths",
"version": "1.0.0",
"type": "module",
"private": true,
"dependencies": {
"env-paths": "2.2.1"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/env-paths@2.2.1",
"kind": "HOW",
"packages": [
"pkg:npm/env-paths@2.2.1"
]
}
import assert from 'node:assert/strict';
import os from 'node:os';
import path from 'node:path';
import process from 'node:process';
import envPaths from 'env-paths';
// 1. envPaths returns an object containing data, config, cache, log, and temp directory paths
{
const paths = envPaths('myapp', { suffix: false });
assert.equal(typeof paths, 'object');
assert.ok(typeof paths.data === 'string' && paths.data.length > 0);
assert.ok(typeof paths.config === 'string' && paths.config.length > 0);
assert.ok(typeof paths.cache === 'string' && paths.cache.length > 0);
assert.ok(typeof paths.log === 'string' && paths.log.length > 0);
assert.ok(typeof paths.temp === 'string' && paths.temp.length > 0);
const homedir = os.homedir();
const tmpdir = os.tmpdir();
const username = path.basename(homedir);
const expectedData = process.env.XDG_DATA_HOME || path.join(homedir, '.local', 'share');
const expectedConfig = process.env.XDG_CONFIG_HOME || path.join(homedir, '.config');
const expectedCache = process.env.XDG_CACHE_HOME || path.join(homedir, '.cache');
const expectedLog = process.env.XDG_STATE_HOME || path.join(homedir, '.local', 'state');
const expectedTemp = path.join(tmpdir, username, 'myapp');
assert.equal(paths.data, path.join(expectedData, 'myapp'));
assert.equal(paths.config, path.join(expectedConfig, 'myapp'));
assert.equal(paths.cache, path.join(expectedCache, 'myapp'));
assert.equal(paths.log, path.join(expectedLog, 'myapp'));
assert.equal(paths.temp, expectedTemp);
}
// 2. envPaths defaults to appending '-nodejs' suffix to the provided application name
{
const paths = envPaths('myapp');
assert.ok(paths.data.endsWith('myapp-nodejs'));
assert.ok(paths.config.endsWith('myapp-nodejs'));
assert.ok(paths.cache.endsWith('myapp-nodejs'));
assert.ok(paths.log.endsWith('myapp-nodejs'));
assert.ok(paths.temp.endsWith('myapp-nodejs'));
}
// 3. envPaths with suffix option set to false disables suffixing and keeps the original application name
{
const paths = envPaths('myapp', { suffix: false });
assert.ok(paths.data.endsWith(path.sep + 'myapp'));
assert.ok(!paths.data.endsWith('myapp-nodejs'));
}
// 4. envPaths with custom suffix option appends the custom suffix string to the application name
{
const paths = envPaths('myapp', { suffix: 'server' });
assert.ok(paths.data.endsWith('myapp-server'));
}
// 5. envPaths validates argument type and throws TypeError when name is not a string
{
assert.throws(
() => {
envPaths(12345);
},
{
name: 'TypeError',
message: 'Expected string, got number',
}
);
}
오리진 시더
익명