{"name":"@yarn-tool/fnm-detect","version":"1.0.8","description":"fnm (Fast Node Manager) 環境偵測模組 / A module for detecting whether the current Node.js process is running within an fnm-managed environment","keywords":["yarn-tool","fnm","fnm-detect","fast-node-manager","node-version-manager","environment-detection","multishell","node","nodejs","version-manager","yarn","npm","workspaces","monorepo"],"homepage":"https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/fnm-detect#readme","bugs":{"url":"https://github.com/bluelovers/ws-yarn-workspaces/issues"},"repository":{"type":"git","url":"git+https://github.com/bluelovers/ws-yarn-workspaces.git","directory":"packages/@yarn-tool/fnm-detect"},"license":"ISC","author":"","sideEffects":false,"type":"commonjs","main":"index.js","scripts":{"review":"pnpm run review:coverage","review:coverage":"pnpm run lint && pnpm run coverage","review:test":"pnpm run lint && pnpm run test","coverage":"pnpm run test -- --coverage","lint":"pnpm run lint:eslint","lint:eslint":"ynpx eslint --ext .ts,.tsx,.mts,.cts ./","pretest":"echo pretest","test":"jest --passWithNoTests","test:jest":"jest --passWithNoTests","test:jest:coverage":"pnpm run test:jest -- --coverage","test:jest:snapshot":"pnpm run test:jest -- -u","test:mocha":"ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","test:snapshot":"pnpm run test -u","test:tsd":"ynpx tsd","test:tsdx":"ynpx @bluelovers/tsdx test --passWithNoTests","build:dts:bundle":"ynpx @bluelovers/dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle","build:dts:copy":"copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts","build:dts:tsc":"pnpm run build:dts:tsc:emit && pnpm run build:dts:copy","build:dts:tsc:emit":"tsc --emitDeclarationOnly --declaration --noEmit false","build:microbundle":"ynpx microbundle --target node","build:tsdx":"ynpx @bluelovers/tsdx build --target node --name index","ci:install":"echo ci:install","ci:build":"echo ci:build","preversion":"echo preversion && pnpm run test","version":"echo version","postversion":"echo postversion","prepublish":"echo prepublish","prepare":"echo prepare","prepublishOnly":"echo prepublishOnly","prepack":"echo prepack","pack":"echo pack","postpack":"echo postpack","publish":"echo publish","postpublish":"echo postpublish","postpublishOnly":"echo postpublishOnly","sort-package-json":"yarn-tool sort","tsc:default":"tsc -p tsconfig.json","tsc:esm":"tsc -p tsconfig.esm.json","tsc:showConfig":"ynpx get-current-tsconfig -p"},"dependencies":{"fs-extra":"^11.4.0","sort-object-keys2":"^3.0.8","ts-type":"^3.0.13","tslib":">=2.8.1","upath2":"^3.1.25"},"publishConfig":{"access":"public"},"gitHead":"008888d233d299e89673cbc45a2712ba9bf825c1","types":"./index.d.ts","_id":"@yarn-tool/fnm-detect@1.0.8","_nodeVersion":"26.7.0","_npmVersion":"lerna/7.4.2/node@v26.7.0+x64 (win32)","dist":{"integrity":"sha512-UemCxZ/VtAglzjTVDnuhvK973+xtrpsImBJ4HeNUkGAjo22r6ImSxnYw2YfYutKRsGPoD3gaBabNCdQjvco0dw==","shasum":"0ba0e5bdfd0ddb6e52689cbcdff23bb8d069bfdb","tarball":"http://registry-npm.ywwl.com/@yarn-tool/fnm-detect/download/@yarn-tool/fnm-detect-1.0.8.tgz","fileCount":6,"unpackedSize":97813,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEu+1MFqL/ED5jvph1mxLeDNp6avkk3PVVpS7skbaQwvAiA1RrfAelKYwJUgXRyt4krZpHnjk6H8zBeI97aImVoRNg=="}],"size":25688,"noattachment":false,"key":"/@yarn-tool/fnm-detect/-/@yarn-tool/fnm-detect-1.0.8.tgz"},"_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"directories":{},"maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fnm-detect_1.0.8_1788737088302_0.9346236500143874"},"_hasShrinkwrap":false,"readme":"# @yarn-tool/fnm-detect\n\nfnm (Fast Node Manager) 環境偵測模組，用於偵測當前 Node.js 程序是否在 fnm 管理的環境中執行。\nA module for detecting whether the current Node.js process is running within an fnm-managed environment.\n\n## 安裝 (Installation)\n\n```bash\n# 使用 yarn / Using yarn\nyarn add @yarn-tool/fnm-detect\n\n# 使用 yarn-tool / Using yarn-tool\nyarn-tool add @yarn-tool/fnm-detect\n# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool\nyt add @yarn-tool/fnm-detect\n\n# 使用 pnpm / Using pnpm\npnpm add @yarn-tool/fnm-detect\n\n# 使用 npm / Using npm\nnpm install @yarn-tool/fnm-detect\n```\n\n## 使用範例 (Usage Example)\n\n```typescript\nimport {\n  detectFnmByExecPath,\n  detectFnmByEnv,\n  detectFnmByAll,\n  isFNM\n} from '@yarn-tool/fnm-detect';\n\n// 簡單檢查是否在 fnm 環境中 / Simple check for fnm environment\nif (isFNM()) {\n  console.log('Running under fnm');\n}\n\n// 透過 execPath 偵測 / Detect via execPath\nconst result = detectFnmByExecPath();\nconsole.log(result);\n// {\n//   isFnm: true,\n//   detectedBy: 'execpath',\n//   fnmPathType: 'fnm_multishells',\n//   fnmPath: 'C:/Users/User/AppData/Local/fnm_multishells/20128_1771488837711',\n//   fnmPathReal: 'C:/Users/User/AppData/Roaming/fnm/node-versions/v24.13.1/installation',\n//   fnmDir: 'C:/Users/User/AppData/Roaming/fnm',\n//   multishellKey: '20128_1771488837711',\n//   version: 'v24.13.1',\n//   ...\n// }\n\n// 透過環境變數偵測 / Detect via environment variables\nconst envResult = detectFnmByEnv(process.env);\n\n// 結合兩種偵測方式 / Combine both detection methods\nconst allResult = detectFnmByAll();\nconsole.log(allResult.detectedBy); // ['execpath', 'env'] 或 ['execpath'] 或 ['env'] 或 []\n```\n\n## API\n\n### `detectFnmByExecPath(execPath?, nodeVersion?)`\n\n透過 Node.js 執行檔路徑偵測 fnm 環境。\n\n### `detectFnmByEnv(env?, nodeVersion?)`\n\n透過環境變數 (FNM_DIR, FNM_MULTISHELL_PATH) 偵測 fnm 環境。\n\n### `detectFnmByAll(pc?)`\n\n同時使用 execPath 與環境變數兩種方式偵測。\n\n### `isFNM()`\n\n簡單檢查當前程序是否在 fnm 下執行，返回布林值。\n\n### `detectFnmPathType(fnmPath, inDeep?)`\n\n分析 fnm 路徑類型 (fnm_multishells, aliases, node-versions)。\n\n## 回傳結果類型 (Result Types)\n\n### IDetectFnmByResult\n\n| 屬性 | 說明 / Description |\n|------|-------------------|\n| `isFnm` | 是否偵測到 fnm 環境 / Whether fnm is detected |\n| `detectedBy` | 偵測來源 (execpath/env) / Detection source |\n| `fnmPathType` | 路徑類型 / Path type |\n| `fnmPath` | fnm 路徑 / fnm path |\n| `fnmPathReal` | 真實路徑（解析符號連結後）/ Real path after resolving symlinks |\n| `fnmDir` | fnm 主目錄 / fnm main directory |\n| `multishellPath` | Multishell 路徑 / Multishell path |\n| `multishellKey` | Multishell 鍵值 / Multishell key |\n| `version` | Node.js 版本 / Node.js version |\n| `installationPath` | 安裝路徑 / Installation path |\n| `aliasDefaultPath` | 預設別名路徑 / Default alias path |\n\n## License\n\nISC","publish_time":1788737088440,"_cnpm_publish_time":1788737088440,"dist-tags":{"latest":"1.0.15"}}