@iobroker/db-base
Advanced tools
Comparing version 1.2.4 to 4.0.0-alpha.1-20210830-d9828cd3
@@ -1,49 +0,5 @@ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const { tools } = require('@iobroker/js-controller-common'); | ||
function getControllerDir() { | ||
const possibilities = ['iobroker.js-controller', 'ioBroker.js-controller']; | ||
for (const pkg of possibilities) { | ||
try { | ||
// package.json is guaranteed to be in the module root folder | ||
// so once that is resolved, take the dirname and we're done | ||
const possiblePath = require.resolve(`${pkg}/package.json`); | ||
if (fs.existsSync(possiblePath)) { | ||
return path.dirname(possiblePath); | ||
} | ||
} catch { | ||
/* not found */ | ||
} | ||
} | ||
// Apparently, checking vs null/undefined may miss the odd case of controllerPath being "" | ||
// Thus we check for falsyness, which includes failing on an empty path | ||
let checkPath = path.join(__dirname, '../..'); | ||
// Also check in the current check dir (along with iobroker.js-controller subdirs) | ||
possibilities.unshift(''); | ||
while (true) { | ||
for (const pkg of possibilities) { | ||
try { | ||
const possiblePath = path.join(checkPath, pkg); | ||
if (fs.existsSync(path.join(possiblePath, 'lib/tools.js'))) { | ||
return possiblePath; | ||
} | ||
} catch { | ||
// not found, continue with next possiblity | ||
} | ||
} | ||
// Controller not found here - go to the parent dir | ||
const newPath = path.dirname(checkPath); | ||
if (newPath === checkPath) { | ||
// We already reached the root dir, abort | ||
break; | ||
} | ||
checkPath = newPath; | ||
} | ||
} | ||
const controllerDir = getControllerDir() || __dirname; | ||
module.exports = require(path.join(controllerDir , 'lib/tools.js')); | ||
module.exports = tools; | ||
const controllerDir = tools.getControllerDir() || __dirname; | ||
module.exports.getControllerDir = () => controllerDir; | ||
@@ -50,0 +6,0 @@ |
{ | ||
"name": "@iobroker/db-base", | ||
"version": "1.2.4", | ||
"version": "4.0.0-alpha.1-20210830-d9828cd3", | ||
"engines": { | ||
"node": ">=10.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
"dependencies": { | ||
"@iobroker/js-controller-common": "4.0.0-alpha.1-20210830-d9828cd3", | ||
"deep-clone": "^3.0.3", | ||
"fs-extra": "^9.1.0", | ||
"fs-extra": "^10.0.0", | ||
"node.extend": "^2.0.2", | ||
@@ -22,7 +23,7 @@ "respjs": "^4.2.0" | ||
"Apollon77 <iobroker@fischer-ka.de>", | ||
"foxriver76" | ||
"foxriver76 <moritz.heusinger@gmail.com>" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ioBroker/ioBroker.objects-redis" | ||
"url": "https://github.com/ioBroker/ioBroker.js-controller/packages/db-base" | ||
}, | ||
@@ -35,3 +36,3 @@ "scripts": {}, | ||
}, | ||
"gitHead": "43db6ddccf43383a6df968218ecc58e1d61a70e3" | ||
"gitHead": "c4f5768a90b13b9f629eddf566b3205b39e11939" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
29299
5
673
2
+ Added@iobroker/js-controller-common@4.0.0-alpha.1-20210830-d9828cd3
+ Added@alcalzone/pak@0.6.0(transitive)
+ Added@colors/colors@1.6.0(transitive)
+ Added@dabh/diagnostics@2.0.3(transitive)
+ Added@iobroker/js-controller-common@4.0.0-alpha.1-20210830-d9828cd3(transitive)
+ Added@types/triple-beam@1.3.5(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedaxios@0.21.4(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcolor@3.2.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedcolorspace@1.1.4(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedduplexer@0.1.2(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedenabled@2.0.0(transitive)
+ Addedevent-stream@4.0.1(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfecha@4.2.3(transitive)
+ Addedfile-stream-rotator@0.6.1(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedfn.name@1.1.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfrom@0.1.7(transitive)
+ Addedfs-extra@10.1.0(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglossy@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedkuler@2.0.0(transitive)
+ Addedlogform@2.7.0(transitive)
+ Addedmap-stream@0.0.7(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-forge@0.10.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-hash@2.2.0(transitive)
+ Addedone-time@1.0.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpause-stream@0.0.11(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpromisify-child-process@4.1.2(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedreadline@1.3.0(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedseq-logging@0.4.6(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedsplit@1.0.1(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstack-trace@0.0.10(transitive)
+ Addedstream-combiner@0.2.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedtext-hex@1.0.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtriple-beam@1.4.1(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedunix-dgram@2.0.6(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwinston@3.17.0(transitive)
+ Addedwinston-daily-rotate-file@4.7.1(transitive)
+ Addedwinston-seq-updated@1.0.4(transitive)
+ Addedwinston-syslog@2.7.1(transitive)
+ Addedwinston-transport@4.9.0(transitive)
Updatedfs-extra@^10.0.0