获取package.json路径?

时间:2015-08-27 17:52:13

标签: node.js

我想创建相对于项目根目录的文件路径。我知道(null)将在项目根目录中。有没有一种很好的方法可以通过搜索文件树来找到package.json的文件路径?

1 个答案:

答案 0 :(得分:1)

模块fs-finder有一个Dim objWshShell,IE Set objWshShell = Wscript.CreateObject("Wscript.Shell") Set IE = CreateObject("InternetExplorer.Application") objWshShell.AppActivate IE With IE 'set browser to view .Visible = True 'goes straight to needed screen .Navigate "https://test/Default.aspx" 'Wait for Browser Do While .Busy or .ReadyState <> 4: WScript.Sleep 100: Loop Dim oDoc Set oDoc = .Document With oDoc 'pass through first screen '*** this screen has links too, but there is also an input box that you can use, so it's easy to get through .getElementsByName("in_2515_60").Item(0).Value = 5 .Forms(0).Submit() 'page down on next screen For each item in .Forms(0) If Instr(1,item.name, "[pagedn]") Then item.click() Exit For End If Next 方法,可以让你大部分都在那里。