Buckets:
| import isDockerFunction from 'next/dist/compiled/is-docker' | |
| import isWslBoolean from 'next/dist/compiled/is-wsl' | |
| import os from 'os' | |
| import * as ciEnvironment from '../server/ci-info' | |
| type AnonymousMeta = { | |
| systemPlatform: NodeJS.Platform | |
| systemRelease: string | |
| systemArchitecture: string | |
| cpuCount: number | |
| cpuModel: string | null | |
| cpuSpeed: number | null | |
| memoryInMb: number | |
| isDocker: boolean | |
| isNowDev: boolean | |
| isWsl: boolean | |
| isCI: boolean | |
| ciName: string | null | |
| nextVersion: string | |
| } | |
| let traits: AnonymousMeta | undefined | |
| export function getAnonymousMeta(): AnonymousMeta { | |
| if (traits) { | |
| return traits | |
| } | |
| const cpus = os.cpus() || [] | |
| const { NOW_REGION } = process.env | |
| traits = { | |
| // Software information | |
| systemPlatform: os.platform(), | |
| systemRelease: os.release(), | |
| systemArchitecture: os.arch(), | |
| // Machine information | |
| cpuCount: cpus.length, | |
| cpuModel: cpus.length ? cpus[0].model : null, | |
| cpuSpeed: cpus.length ? cpus[0].speed : null, | |
| memoryInMb: Math.trunc(os.totalmem() / Math.pow(1024, 2)), | |
| // Environment information | |
| isDocker: isDockerFunction(), | |
| isNowDev: NOW_REGION === 'dev1', | |
| isWsl: isWslBoolean, | |
| isCI: ciEnvironment.isCI, | |
| ciName: (ciEnvironment.isCI && ciEnvironment.name) || null, | |
| nextVersion: process.env.__NEXT_VERSION as string, | |
| } | |
| return traits | |
| } | |
Xet Storage Details
- Size:
- 1.37 kB
- Xet hash:
- 75f663595d3160f7f7fe73224bb85283621c818fcd90096efae2a4c75f2dc124
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.