Comparing version
{ | ||
"name": "nw", | ||
"version": "0.88.0-2-sdk", | ||
"version": "0.88.0-3-sdk", | ||
"description": "An installer for nw.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -93,3 +93,3 @@ # nw | ||
import { findpath } from 'nw'; | ||
var path = findpath(); | ||
let path = await findpath(); | ||
``` | ||
@@ -101,3 +101,3 @@ | ||
import { findpath } from 'nw'; | ||
var path = findpath('chromedriver'); | ||
let path = await findpath('chromedriver', { flavor: 'sdk' }); | ||
``` | ||
@@ -104,0 +104,0 @@ |
@@ -46,4 +46,4 @@ import fs from 'node:fs'; | ||
* Get the platform dependant path of the NW.js or ChromeDriver binary. | ||
* | ||
* @param {'nwjs' | 'chromedriver'} executable Path to NW.js or Chromedriver executable. | ||
* | ||
* @param {'nwjs' | 'chromedriver' | 'all'} Path to NW.js or Chromedriver executable. | ||
* @return {Promise<string>} | ||
@@ -54,6 +54,6 @@ */ | ||
const nwDir = path.resolve(__dirname, '..', `nwjs${options.flavor === "sdk" ? "-sdk" : ""}-v${options.version}-${options.platform}-${options.arch}`); | ||
/** | ||
* File path to executable. | ||
* | ||
* | ||
* @type {string} | ||
@@ -64,2 +64,9 @@ */ | ||
/** | ||
* Get the platform dependant path of the NW.js directory containing everything. | ||
*/ | ||
function findDir() { | ||
binPath = nwDir; | ||
} | ||
/** | ||
* Get the platform dependant path of the NW.js binary. | ||
@@ -82,2 +89,4 @@ */ | ||
findChromeDriver(); | ||
} else if (executable === 'all') { | ||
findDir(); | ||
} else { | ||
@@ -84,0 +93,0 @@ console.error(`[ ERROR ] Expected nwjs or chromedriver, got ${executable}.`); |
35678
0.67%841
0.96%