You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

module-root-sync

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-root-sync - npm Package Compare versions

Comparing version
0.1.0
to
0.1.1
+1
-1
dist/cjs/index.js.map

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/module-root-sync/src/index.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport existsSync from 'fs-exists-sync';\n\nexport default function moduleRoot(dir) {\n const packagePath = path.join(dir, 'package.json');\n if (existsSync(packagePath) && JSON.parse(fs.readFileSync(packagePath, 'utf8')).name) return dir;\n const nextDir = path.dirname(dir);\n if (nextDir === dir) throw new Error('Package root not found');\n return moduleRoot(nextDir);\n}\n"],"names":["moduleRoot","dir","packagePath","path","join","existsSync","JSON","parse","fs","readFileSync","name","nextDir","dirname","Error"],"mappings":";;;;+BAIA;;;eAAwBA;;;yDAJT;2DACE;mEACM;;;;;;AAER,SAASA,WAAWC,GAAG;IACpC,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACH,KAAK;IACnC,IAAII,IAAAA,qBAAU,EAACH,gBAAgBI,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACP,aAAa,SAASQ,IAAI,EAAE,OAAOT;IAC7F,IAAMU,UAAUR,aAAI,CAACS,OAAO,CAACX;IAC7B,IAAIU,YAAYV,KAAK,MAAM,IAAIY,MAAM;IACrC,OAAOb,WAAWW;AACpB"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/module-root-sync/src/index.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport existsSync from 'fs-exists-sync';\n\nexport default function moduleRoot(dir: string): string {\n const packagePath = path.join(dir, 'package.json');\n if (existsSync(packagePath) && JSON.parse(fs.readFileSync(packagePath, 'utf8')).name) return dir;\n const nextDir = path.dirname(dir);\n if (nextDir === dir) throw new Error('Package root not found');\n return moduleRoot(nextDir);\n}\n"],"names":["moduleRoot","dir","packagePath","path","join","existsSync","JSON","parse","fs","readFileSync","name","nextDir","dirname","Error"],"mappings":";;;;+BAIA;;;eAAwBA;;;yDAJT;2DACE;mEACM;;;;;;AAER,SAASA,WAAWC,GAAW;IAC5C,IAAMC,cAAcC,aAAI,CAACC,IAAI,CAACH,KAAK;IACnC,IAAII,IAAAA,qBAAU,EAACH,gBAAgBI,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACP,aAAa,SAASQ,IAAI,EAAE,OAAOT;IAC7F,IAAMU,UAAUR,aAAI,CAACS,OAAO,CAACX;IAC7B,IAAIU,YAAYV,KAAK,MAAM,IAAIY,MAAM;IACrC,OAAOb,WAAWW;AACpB"}

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/module-root-sync/src/index.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport existsSync from 'fs-exists-sync';\n\nexport default function moduleRoot(dir) {\n const packagePath = path.join(dir, 'package.json');\n if (existsSync(packagePath) && JSON.parse(fs.readFileSync(packagePath, 'utf8')).name) return dir;\n const nextDir = path.dirname(dir);\n if (nextDir === dir) throw new Error('Package root not found');\n return moduleRoot(nextDir);\n}\n"],"names":["fs","path","existsSync","moduleRoot","dir","packagePath","join","JSON","parse","readFileSync","name","nextDir","dirname","Error"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,gBAAgB,iBAAiB;AAExC,eAAe,SAASC,WAAWC,GAAG;IACpC,MAAMC,cAAcJ,KAAKK,IAAI,CAACF,KAAK;IACnC,IAAIF,WAAWG,gBAAgBE,KAAKC,KAAK,CAACR,GAAGS,YAAY,CAACJ,aAAa,SAASK,IAAI,EAAE,OAAON;IAC7F,MAAMO,UAAUV,KAAKW,OAAO,CAACR;IAC7B,IAAIO,YAAYP,KAAK,MAAM,IAAIS,MAAM;IACrC,OAAOV,WAAWQ;AACpB"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/module-root-sync/src/index.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport existsSync from 'fs-exists-sync';\n\nexport default function moduleRoot(dir: string): string {\n const packagePath = path.join(dir, 'package.json');\n if (existsSync(packagePath) && JSON.parse(fs.readFileSync(packagePath, 'utf8')).name) return dir;\n const nextDir = path.dirname(dir);\n if (nextDir === dir) throw new Error('Package root not found');\n return moduleRoot(nextDir);\n}\n"],"names":["fs","path","existsSync","moduleRoot","dir","packagePath","join","JSON","parse","readFileSync","name","nextDir","dirname","Error"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,OAAOC,UAAU,OAAO;AACxB,OAAOC,gBAAgB,iBAAiB;AAExC,eAAe,SAASC,WAAWC,GAAW;IAC5C,MAAMC,cAAcJ,KAAKK,IAAI,CAACF,KAAK;IACnC,IAAIF,WAAWG,gBAAgBE,KAAKC,KAAK,CAACR,GAAGS,YAAY,CAACJ,aAAa,SAASK,IAAI,EAAE,OAAON;IAC7F,MAAMO,UAAUV,KAAKW,OAAO,CAACR;IAC7B,IAAIO,YAAYP,KAAK,MAAM,IAAIS,MAAM;IACrC,OAAOV,WAAWQ;AACpB"}

@@ -1,1 +0,1 @@

export default function moduleRoot(dir: any): any;
export default function moduleRoot(dir: string): string;
{
"name": "module-root-sync",
"version": "0.1.0",
"version": "0.1.1",
"description": "Finds the directory that the modules resides in",

@@ -5,0 +5,0 @@ "keywords": [