{"name":"@yarn-tool/fnm-detect","version":"1.0.5","keywords":["yarn-tool","fnm","fnm-detect","fast-node-manager","node-version-manager","environment-detection","multishell","node","nodejs","version-manager","yarn","npm","workspaces","monorepo"],"author":"","license":"ISC","_id":"@yarn-tool/fnm-detect@1.0.5","maintainers":[{"name":"bluelovers","email":"codelovers@users.sourceforge.net"}],"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"},"dist":{"shasum":"32bee2b9068ab47921bb56607d4dfebe8a70e09b","tarball":"http://registry-npm.ywwl.com/@yarn-tool/fnm-detect/download/@yarn-tool/fnm-detect-1.0.5.tgz","fileCount":6,"integrity":"sha512-pdfJqHJ1ByTRgliaMVcdAB6Lh37OI17N60+lY2jCdvJ7gbIC4dfBUctIKyJQIYlIfmRgSFpzMit5Jz4RdoD0Hw==","signatures":[{"sig":"MEUCIGvpE+Xpad59Xh/7MbQpJ8BAkICnc8bMMTlK7w95dyYlAiEAuBpNDe9WAaPfOYOc5MNZwQTtCQc4Tsc9nAR/bBw2IFE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95749,"size":25045,"noattachment":false,"key":"/@yarn-tool/fnm-detect/-/@yarn-tool/fnm-detect-1.0.5.tgz"},"main":"index.js","type":"commonjs","types":"./index.d.ts","gitHead":"ca3fae2bbdf31ed1ce9bab14793912026200767e","scripts":{"lint":"yarn run lint:eslint","pack":"echo pack","test":"jest --passWithNoTests","review":"yarn run review:coverage","prepack":"echo prepack","prepare":"echo prepare","pretest":"echo pretest","publish":"echo publish","tsc:esm":"tsc -p tsconfig.esm.json","version":"echo version","ci:build":"echo ci:build","coverage":"yarn run test -- --coverage","postpack":"echo postpack","test:tsd":"ynpx tsd","test:jest":"jest --passWithNoTests","test:tsdx":"ynpx @bluelovers/tsdx test --passWithNoTests","build:tsdx":"ynpx @bluelovers/tsdx build --target node --name index","ci:install":"echo ci:install","prepublish":"echo prepublish","preversion":"echo preversion && yarn run test","test:mocha":"ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"","lint:eslint":"ynpx eslint --ext .ts,.tsx,.mts,.cts ./","postpublish":"echo postpublish","postversion":"echo postversion","review:test":"yarn run lint && yarn run test","tsc:default":"tsc -p tsconfig.json","build:dts:tsc":"yarn run build:dts:tsc:emit && yarn run build:dts:copy","test:snapshot":"yarn run test -- -u","build:dts:copy":"copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts","prepublishOnly":"echo prepublishOnly","tsc:showConfig":"ynpx get-current-tsconfig -p","postpublishOnly":"echo postpublishOnly","review:coverage":"yarn run lint && yarn run coverage","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:microbundle":"ynpx microbundle --target node","sort-package-json":"yarn-tool sort","build:dts:tsc:emit":"tsc --emitDeclarationOnly --declaration --noEmit false","test:jest:coverage":"yarn run test:jest -- --coverage","test:jest:snapshot":"yarn run test:jest -- -u"},"_npmUser":{"name":"bluelovers","email":"codelovers@users.sourceforge.net"},"repository":{"url":"git+https://github.com/bluelovers/ws-yarn-workspaces.git","type":"git","directory":"packages/@yarn-tool/fnm-detect"},"_npmVersion":"lerna/9.0.5/node@v24.13.1+x64 (win32)","description":"fnm (Fast Node Manager) 環境偵測模組 / A module for detecting whether the current Node.js process is running within an fnm-managed environment","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"tslib":">=2","upath2":"^3.1.23","ts-type":"^3.0.8","fs-extra":"^11.3.4","sort-object-keys2":"^3.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fnm-detect_1.0.5_1773038136436_0.8164024204532323","host":"s3://npm-registry-packages-npm-production"},"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":1773038136585,"_cnpm_publish_time":1773038136585,"dist-tags":{"latest":"1.0.15"}}