Comparing version 0.81.0 to 0.82.0-sdk
@@ -1,20 +0,57 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var bindir = path.resolve(__dirname, '..', 'nwjs'); | ||
const { env, platform } = require('node:process'); | ||
const { join, resolve } = require('node:path'); | ||
module.exports = function() { | ||
var bin = bindir; | ||
var platform = process.env.npm_config_nwjs_platform || process.env.NWJS_PLATFORM || process.platform; | ||
if (platform === 'darwin') { | ||
if (fs.existsSync(path.join(bin, 'Contents'))) { | ||
bin = path.join(bin, 'Contents', 'MacOS', 'nwjs'); | ||
/** | ||
* Get the platform dependant path of the NW.js or ChromeDriver binary. | ||
* | ||
* @param {'nwjs' | 'chromedriver'} executable Path to NW.js or Chromedriver executable. | ||
* @return {string} | ||
*/ | ||
function findpath(executable = 'nwjs') { | ||
const nwDir = resolve(__dirname, '..', 'nwjs'); | ||
/** | ||
* File path to executable. | ||
* | ||
* @type {string} | ||
*/ | ||
let binPath = ''; | ||
/** | ||
* Host operating system | ||
* | ||
* @type {NodeJS.Platform} | ||
*/ | ||
let hostOs = env.npm_config_nwjs_platform || env.NWJS_PLATFORM || platform; | ||
/** | ||
* Get the platform dependant path of the NW.js binary. | ||
*/ | ||
function findNwjs() { | ||
if (hostOs === 'darwin') { | ||
binPath = join(nwDir, 'nwjs.app', 'Contents', 'MacOS', 'nwjs'); | ||
} else if (hostOs === 'win32') { | ||
binPath = join(nwDir, 'nw.exe'); | ||
} else { | ||
bin = path.join(bin, 'nwjs.app', 'Contents', 'MacOS', 'nwjs'); | ||
binPath = join(nwDir, 'nw'); | ||
} | ||
} else if (platform === 'win32') { | ||
bin = path.join(bin, 'nw.exe'); | ||
} | ||
/** | ||
* Get the platform dependant path of the ChromeDriver binary. | ||
*/ | ||
function findChromeDriver() { | ||
binPath = resolve(nwDir, `chromedriver${platform === "win32" ? ".exe" : ""}`); | ||
} | ||
if (executable === 'nwjs') { | ||
findNwjs(); | ||
} else if (executable === 'chromedriver') { | ||
findChromeDriver(); | ||
} else { | ||
bin = path.join(bin, 'nw'); | ||
console.error(`[ ERROR ] Expected nwjs or chromedriver, got ${executable}.`); | ||
} | ||
return bin; | ||
return binPath; | ||
} | ||
module.exports = { findpath }; |
{ | ||
"name": "nw", | ||
"version": "0.81.0", | ||
"version": "0.82.0-sdk", | ||
"description": "A installer for nw.js", | ||
@@ -9,36 +9,32 @@ "repository": { | ||
}, | ||
"main": "index.js", | ||
"main": "lib/findpath.js", | ||
"bin": { | ||
"nw": "bin/nw" | ||
"nw": "bin/nw.js" | ||
}, | ||
"scripts": { | ||
"postinstall": "node scripts/install.js", | ||
"test": "node --test-reporter=spec --test test/index.mjs" | ||
"postinstall": "node lib/install.js", | ||
"test": "node --test-reporter=spec --test test/index.js", | ||
"dry-run": "nw ./test/app" | ||
}, | ||
"files": [ | ||
"lib", | ||
"bin", | ||
"scripts", | ||
"index.js" | ||
"bin" | ||
], | ||
"author": "Kyle Robinson Young", | ||
"author": { | ||
"name": "Kyle Robinson Young", | ||
"url": "https://github.com/shama" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "nwjs/npm-installer Contributors", | ||
"url": "https://github.com/nwjs/npm-installer/graphs/contributors" | ||
} | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"chalk": "~1.1.3", | ||
"decompress": "^4.2.0", | ||
"download": "^5.0.3", | ||
"file-exists": "^2.0.0", | ||
"merge": "^2.1.1", | ||
"progress": "^2.0.3", | ||
"rimraf": "^2.2.8", | ||
"semver": "^5.1.0", | ||
"cli-progress": "^3.12.0", | ||
"compressing": "^1.10.0", | ||
"semver": "^7.5.4", | ||
"yargs": "^3.2.1" | ||
}, | ||
"devDependencies": { | ||
"request": "^2.53.0" | ||
}, | ||
"engines": { | ||
"node": "v20.5.0" | ||
}, | ||
"packageManager": "npm@9.8.1", | ||
"keywords": [ | ||
@@ -56,2 +52,2 @@ "nw", | ||
] | ||
} | ||
} |
@@ -106,2 +106,12 @@ # nw | ||
## finding the path to the chromedriver binary | ||
If you would like to programmatically retrieve the path to the chromedriver use: | ||
``` js | ||
var findpath = require('nw').findpath; | ||
var chromedriver_path = findpath('chromedriver'); | ||
// chromedriver_path will equal the path to the binary depending on your environment | ||
``` | ||
Then you can use that path to run NW.js programmatically. For example, to run in the current script's directory: | ||
@@ -108,0 +118,0 @@ |
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
16186
4
0
313
174
1
6
1
+ Addedcli-progress@^3.12.0
+ Addedcompressing@^1.10.0
+ Added@eggjs/yauzl@2.11.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedcli-progress@3.12.0(transitive)
+ Addedcompressing@1.10.1(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfd-slicer2@1.2.0(transitive)
+ Addedflushwritable@1.0.0(transitive)
+ Addedget-ready@1.0.0(transitive)
+ Addediconv-lite@0.5.2(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedstreamifier@0.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedyazl@2.5.1(transitive)
- Removedchalk@~1.1.3
- Removeddecompress@^4.2.0
- Removeddownload@^5.0.3
- Removedfile-exists@^2.0.0
- Removedmerge@^2.1.1
- Removedprogress@^2.0.3
- Removedrimraf@^2.2.8
- Removedansi-styles@2.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcapture-stack-trace@1.0.2(transitive)
- Removedcaw@2.0.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconfig-chain@1.1.13(transitive)
- Removedcreate-error-class@3.0.2(transitive)
- Removeddecompress@4.2.1(transitive)
- Removeddecompress-tar@4.1.1(transitive)
- Removeddecompress-tarbz2@4.1.1(transitive)
- Removeddecompress-targz@4.1.1(transitive)
- Removeddecompress-unzip@4.0.1(transitive)
- Removeddownload@5.0.3(transitive)
- Removedduplexer3@0.1.5(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfd-slicer@1.1.0(transitive)
- Removedfile-exists@2.0.0(transitive)
- Removedfile-type@3.9.05.2.06.2.0(transitive)
- Removedfilename-reserved-regex@2.0.0(transitive)
- Removedfilenamify@2.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedget-proxy@2.1.0(transitive)
- Removedget-stream@2.3.13.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedgot@6.7.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-symbol-support-x@1.4.2(transitive)
- Removedhas-to-string-tag-x@1.4.1(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedini@1.3.8(transitive)
- Removedis-natural-number@4.0.1(transitive)
- Removedis-object@1.0.2(transitive)
- Removedis-redirect@1.0.0(transitive)
- Removedis-retry-allowed@1.2.0(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisurl@1.0.0(transitive)
- Removedlowercase-keys@1.0.1(transitive)
- Removedmake-dir@1.3.0(transitive)
- Removedmerge@2.1.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removednpm-conf@1.1.3(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpify@2.3.03.0.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedprepend-http@1.0.4(transitive)
- Removedprogress@2.0.3(transitive)
- Removedproto-list@1.2.4(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedseek-bzip@1.0.6(transitive)
- Removedsemver@5.7.2(transitive)
- Removedstrip-dirs@2.1.0(transitive)
- Removedstrip-outer@1.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedtimed-out@4.0.1(transitive)
- Removedtrim-repeated@1.0.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedunbzip2-stream@1.4.3(transitive)
- Removedunzip-response@2.0.1(transitive)
- Removedurl-parse-lax@1.0.0(transitive)
- Removedurl-to-options@1.0.1(transitive)
- Removedyauzl@2.10.0(transitive)
Updatedsemver@^7.5.4