muhammara 2.1.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/README.md +2 -2
  3. package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +7 -0
  4. package/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js +1 -1
  5. package/node_modules/@mapbox/node-pre-gyp/package.json +11 -12
  6. package/node_modules/ansi-regex/package.json +1 -2
  7. package/node_modules/brace-expansion/package.json +2 -1
  8. package/node_modules/concat-map/package.json +1 -1
  9. package/node_modules/console-control-strings/package.json +1 -1
  10. package/node_modules/debug/README.md +3 -0
  11. package/node_modules/debug/package.json +5 -5
  12. package/node_modules/debug/src/common.js +1 -1
  13. package/node_modules/delegates/package.json +1 -1
  14. package/node_modules/detect-libc/README.md +124 -42
  15. package/node_modules/detect-libc/index.d.ts +11 -0
  16. package/node_modules/detect-libc/lib/detect-libc.js +166 -80
  17. package/node_modules/detect-libc/lib/process.js +16 -0
  18. package/node_modules/detect-libc/package.json +20 -19
  19. package/node_modules/fs.realpath/package.json +1 -1
  20. package/node_modules/gauge/CHANGELOG.md +163 -0
  21. package/node_modules/gauge/LICENSE +13 -0
  22. package/node_modules/gauge/README.md +1 -1
  23. package/node_modules/gauge/{lib/base-theme.js → base-theme.js} +3 -7
  24. package/node_modules/gauge/{lib/error.js → error.js} +0 -0
  25. package/node_modules/gauge/{lib/has-color.js → has-color.js} +0 -0
  26. package/node_modules/gauge/{lib/index.js → index.js} +32 -89
  27. package/node_modules/gauge/package.json +42 -37
  28. package/node_modules/gauge/{lib/plumbing.js → plumbing.js} +1 -3
  29. package/node_modules/gauge/{lib/process.js → process.js} +0 -0
  30. package/node_modules/gauge/{lib/progress-bar.js → progress-bar.js} +5 -11
  31. package/node_modules/gauge/{lib/render-template.js → render-template.js} +24 -68
  32. package/node_modules/gauge/{lib/set-immediate.js → set-immediate.js} +0 -0
  33. package/node_modules/gauge/{lib/set-interval.js → set-interval.js} +0 -0
  34. package/node_modules/gauge/{lib/spin.js → spin.js} +0 -0
  35. package/node_modules/gauge/{lib/template-item.js → template-item.js} +6 -21
  36. package/node_modules/gauge/{lib/theme-set.js → theme-set.js} +23 -31
  37. package/node_modules/gauge/{lib/themes.js → themes.js} +13 -13
  38. package/node_modules/gauge/{lib/wide-truncate.js → wide-truncate.js} +3 -9
  39. package/node_modules/glob/common.js +2 -0
  40. package/node_modules/glob/glob.js +4 -1
  41. package/node_modules/glob/package.json +9 -6
  42. package/node_modules/glob/sync.js +6 -3
  43. package/node_modules/has-unicode/package.json +1 -1
  44. package/node_modules/https-proxy-agent/dist/agent.js +2 -5
  45. package/node_modules/https-proxy-agent/dist/agent.js.map +1 -1
  46. package/node_modules/https-proxy-agent/package.json +5 -5
  47. package/node_modules/inflight/package.json +1 -1
  48. package/node_modules/minimatch/README.md +22 -1
  49. package/node_modules/minimatch/minimatch.js +93 -69
  50. package/node_modules/minimatch/package.json +16 -15
  51. package/node_modules/minipass/index.js +6 -1
  52. package/node_modules/minipass/package.json +5 -5
  53. package/node_modules/node-fetch/lib/index.es.js +28 -2
  54. package/node_modules/node-fetch/lib/index.js +28 -2
  55. package/node_modules/node-fetch/lib/index.mjs +28 -2
  56. package/node_modules/node-fetch/package.json +18 -10
  57. package/node_modules/npmlog/LICENSE +15 -0
  58. package/node_modules/npmlog/{lib/log.js → log.js} +9 -9
  59. package/node_modules/npmlog/package.json +20 -31
  60. package/node_modules/object-assign/index.js +90 -0
  61. package/node_modules/object-assign/license +21 -0
  62. package/node_modules/object-assign/package.json +74 -0
  63. package/node_modules/object-assign/readme.md +61 -0
  64. package/node_modules/once/package.json +1 -1
  65. package/node_modules/path-is-absolute/package.json +1 -1
  66. package/node_modules/semver/README.md +3 -1
  67. package/node_modules/semver/bin/semver.js +19 -9
  68. package/node_modules/semver/classes/comparator.js +3 -2
  69. package/node_modules/semver/classes/index.js +1 -1
  70. package/node_modules/semver/classes/range.js +31 -22
  71. package/node_modules/semver/classes/semver.js +1 -1
  72. package/node_modules/semver/functions/cmp.js +8 -4
  73. package/node_modules/semver/functions/coerce.js +3 -2
  74. package/node_modules/semver/functions/inc.js +4 -1
  75. package/node_modules/semver/functions/parse.js +1 -1
  76. package/node_modules/semver/internal/constants.js +2 -2
  77. package/node_modules/semver/internal/identifiers.js +1 -1
  78. package/node_modules/semver/internal/parse-options.js +3 -3
  79. package/node_modules/semver/internal/re.js +3 -3
  80. package/node_modules/semver/package.json +46 -13
  81. package/node_modules/semver/ranges/min-version.js +2 -1
  82. package/node_modules/semver/ranges/outside.js +1 -1
  83. package/node_modules/semver/ranges/simplify.js +15 -12
  84. package/node_modules/semver/ranges/subset.js +53 -31
  85. package/node_modules/set-blocking/package.json +1 -1
  86. package/node_modules/signal-exit/index.js +4 -2
  87. package/node_modules/signal-exit/package.json +5 -5
  88. package/package.json +1 -1
  89. package/src/DocumentCopyingContextDriver.cpp +6 -6
  90. package/src/deps/PDFWriter/CMakeLists.txt +8 -0
  91. package/src/deps/PDFWriter/DecryptionHelper.cpp +10 -8
  92. package/src/deps/PDFWriter/Deletable.h +46 -0
  93. package/src/deps/PDFWriter/DocumentContext.h +3 -3
  94. package/src/deps/PDFWriter/IDeletable.h +6 -0
  95. package/src/deps/PDFWriter/InputLZWDecodeStream.cpp +208 -0
  96. package/src/deps/PDFWriter/InputLZWDecodeStream.h +77 -0
  97. package/src/deps/PDFWriter/InputStreamSkipperStream.cpp +1 -1
  98. package/src/deps/PDFWriter/JPEGImageHandler.h +2 -2
  99. package/src/deps/PDFWriter/ObjectsContext.cpp +5 -0
  100. package/src/deps/PDFWriter/ObjectsContext.h +1 -0
  101. package/src/deps/PDFWriter/PDFDocumentHandler.cpp +19 -3
  102. package/src/deps/PDFWriter/PDFObject.cpp +13 -11
  103. package/src/deps/PDFWriter/PDFObject.h +7 -5
  104. package/src/deps/PDFWriter/PDFObjectParser.cpp +8 -0
  105. package/src/deps/PDFWriter/PDFObjectParser.h +6 -0
  106. package/src/deps/PDFWriter/PDFParser.cpp +25 -13
  107. package/src/deps/PDFWriter/PDFParserTokenizer.cpp +25 -24
  108. package/src/deps/PDFWriter/PDFParserTokenizer.h +1 -0
  109. package/src/deps/PDFWriter/PDFWriter.h +2 -2
  110. package/src/deps/PDFWriter/binding.gyp +2 -0
  111. package/node_modules/detect-libc/.npmignore +0 -7
  112. package/node_modules/detect-libc/bin/detect-libc.js +0 -18
  113. package/node_modules/gauge/LICENSE.md +0 -20
  114. package/node_modules/gauge/lib/demo.js +0 -45
  115. package/node_modules/npmlog/LICENSE.md +0 -20
  116. package/node_modules/semver/CHANGELOG.md +0 -111
  117. package/src/deps/PDFWriter/InputPredictorPNGAverageStream.cpp +0 -120
  118. package/src/deps/PDFWriter/InputPredictorPNGAverageStream.h +0 -49
  119. package/src/deps/PDFWriter/InputPredictorPNGNoneStream.cpp +0 -109
  120. package/src/deps/PDFWriter/InputPredictorPNGNoneStream.h +0 -47
  121. package/src/deps/PDFWriter/InputPredictorPNGPaethStream.cpp +0 -136
  122. package/src/deps/PDFWriter/InputPredictorPNGPaethStream.h +0 -51
  123. package/src/deps/PDFWriter/InputPredictorPNGSubStream.cpp +0 -113
  124. package/src/deps/PDFWriter/InputPredictorPNGSubStream.h +0 -47
  125. package/src/deps/PDFWriter/InputPredictorPNGUpStream.cpp +0 -120
  126. package/src/deps/PDFWriter/InputPredictorPNGUpStream.h +0 -49
package/CHANGELOG.md CHANGED
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.4.0] - 2022-06-08
11
+
12
+ ### Added
13
+
14
+ - Electron 18.1, 18.2, 18.3
15
+ - Electron 19.0
16
+
17
+ ### Changed
18
+
19
+ - Update npm dist url to the new url for electron builds
20
+
21
+ ## [2.3.0] - 2022-05-04
22
+
23
+ ### Added
24
+
25
+ - Builds for node and electron with arm64 on darwin (Apple M1)
26
+ - Add electron 18
27
+
28
+ ## [2.2.0] - 2022-03-05
29
+
30
+ ### Changed
31
+
32
+ - Update PDFWriter dependency to the newest available versoin
33
+
34
+ ### Added
35
+
36
+ - Electron version: 17.0, 17.1
37
+ - NodeJs 17.6.0
38
+
10
39
  ## [2.1.0] - 2021-12-03
11
40
 
12
41
  ### Added
@@ -195,7 +224,10 @@ with the following changes.
195
224
 
196
225
  * Initial release
197
226
 
198
- [Unreleased]: https://github.com/julianhille/MuhammaraJS/compare/2.1.0...HEAD
227
+ [Unreleased]: https://github.com/julianhille/MuhammaraJS/compare/2.4.0...HEAD
228
+ [2.4.0]: https://github.com/julianhille/MuhammaraJS/compare/2.3.0...2.4.0
229
+ [2.3.0]: https://github.com/julianhille/MuhammaraJS/compare/2.2.0...2.3.0
230
+ [2.2.0]: https://github.com/julianhille/MuhammaraJS/compare/2.1.0...2.2.0
199
231
  [2.1.0]: https://github.com/julianhille/MuhammaraJS/compare/2.0.0...2.1.0
200
232
  [2.0.0]: https://github.com/julianhille/MuhammaraJS/compare/1.10.0...2.0.0
201
233
  [1.10.0]: https://github.com/julianhille/MuhammaraJS/compare/1.9.0...1.10.0
package/README.md CHANGED
@@ -25,7 +25,7 @@ electron versions because we needed to upgrade node-pre-gyp.
25
25
  # Installation
26
26
 
27
27
  ```
28
- npm install
28
+ npm install muhammara
29
29
 
30
30
  ```
31
31
 
@@ -34,7 +34,7 @@ npm install
34
34
  Replace:
35
35
 
36
36
  ```
37
- let hummus = require('humms')
37
+ let hummus = require('hummus')
38
38
  ```
39
39
 
40
40
  With:
@@ -1,5 +1,12 @@
1
1
  # node-pre-gyp changelog
2
2
 
3
+ ## 1.0.9
4
+ - Upgraded node-fetch to 2.6.7 to address [CVE-2022-0235](https://www.cve.org/CVERecord?id=CVE-2022-0235)
5
+ - Upgraded detect-libc to 2.0.0 to use non-blocking NodeJS(>=12) Report API
6
+
7
+ ## 1.0.8
8
+ - Downgraded npmlog to maintain node v10 and v8 support (https://github.com/mapbox/node-pre-gyp/pull/624)
9
+
3
10
  ## 1.0.7
4
11
  - Upgraded nyc and npmlog to address https://github.com/advisories/GHSA-93q8-gq69-wqmw
5
12
 
@@ -302,7 +302,7 @@ module.exports.evaluate = function(package_json, options, napi_build_version) {
302
302
  target_platform: options.target_platform || process.platform,
303
303
  arch: options.target_arch || process.arch,
304
304
  target_arch: options.target_arch || process.arch,
305
- libc: options.target_libc || detect_libc.family || 'unknown',
305
+ libc: options.target_libc || detect_libc.familySync() || 'unknown',
306
306
  module_main: package_json.main,
307
307
  toolset: options.toolset || '', // address https://github.com/mapbox/node-pre-gyp/issues/119
308
308
  bucket: package_json.binary.bucket,
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@mapbox/node-pre-gyp@^1.0.5",
3
- "_id": "@mapbox/node-pre-gyp@1.0.7",
3
+ "_id": "@mapbox/node-pre-gyp@1.0.9",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-PplSvl4pJ5N3BkVjAdDzpPhVUPdC73JgttkR+LnBx2OORC1GCQsBjUeEuipf9uOaAM1SbxcdZFfR3KDTKm2S0A==",
5
+ "_integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==",
6
6
  "_location": "/@mapbox/node-pre-gyp",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -19,8 +19,8 @@
19
19
  "_requiredBy": [
20
20
  "/"
21
21
  ],
22
- "_resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.7.tgz",
23
- "_shasum": "a26919cac6595662703330d1820a0ca206f45521",
22
+ "_resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz",
23
+ "_shasum": "09a8781a3a036151cdebbe8719d6f8b25d4058bc",
24
24
  "_spec": "@mapbox/node-pre-gyp@^1.0.5",
25
25
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS",
26
26
  "author": {
@@ -35,12 +35,12 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "detect-libc": "^1.0.3",
38
+ "detect-libc": "^2.0.0",
39
39
  "https-proxy-agent": "^5.0.0",
40
40
  "make-dir": "^3.1.0",
41
- "node-fetch": "^2.6.5",
41
+ "node-fetch": "^2.6.7",
42
42
  "nopt": "^5.0.0",
43
- "npmlog": "^6.0.0",
43
+ "npmlog": "^5.0.1",
44
44
  "rimraf": "^3.0.2",
45
45
  "semver": "^7.3.5",
46
46
  "tar": "^6.1.11"
@@ -50,16 +50,15 @@
50
50
  "devDependencies": {
51
51
  "@mapbox/cloudfriend": "^5.1.0",
52
52
  "@mapbox/eslint-config-mapbox": "^3.0.0",
53
- "action-walk": "^2.2.0",
54
- "aws-sdk": "^2.1012.0",
53
+ "aws-sdk": "^2.1087.0",
55
54
  "codecov": "^3.8.3",
56
55
  "eslint": "^7.32.0",
57
56
  "eslint-plugin-node": "^11.1.0",
58
57
  "mock-aws-s3": "^4.0.2",
59
58
  "nock": "^12.0.3",
60
- "node-addon-api": "^4.2.0",
59
+ "node-addon-api": "^4.3.0",
61
60
  "nyc": "^15.1.0",
62
- "tape": "^5.3.1",
61
+ "tape": "^5.5.2",
63
62
  "tar-fs": "^2.1.1"
64
63
  },
65
64
  "homepage": "https://github.com/mapbox/node-pre-gyp#readme",
@@ -94,5 +93,5 @@
94
93
  "update-crosswalk": "node scripts/abi_crosswalk.js",
95
94
  "upload-coverage": "nyc report --reporter json && codecov --clear --flags=unit --file=./coverage/coverage-final.json"
96
95
  },
97
- "version": "1.0.7"
96
+ "version": "1.0.9"
98
97
  }
@@ -16,13 +16,12 @@
16
16
  "fetchSpec": "^5.0.1"
17
17
  },
18
18
  "_requiredBy": [
19
- "/gauge",
20
19
  "/strip-ansi"
21
20
  ],
22
21
  "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
23
22
  "_shasum": "082cb2c89c9fe8659a311a53bd6a4dc5301db304",
24
23
  "_spec": "ansi-regex@^5.0.1",
25
- "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/gauge",
24
+ "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/strip-ansi",
26
25
  "author": {
27
26
  "name": "Sindre Sorhus",
28
27
  "email": "sindresorhus@gmail.com",
@@ -16,7 +16,8 @@
16
16
  "fetchSpec": "^1.1.7"
17
17
  },
18
18
  "_requiredBy": [
19
- "/minimatch"
19
+ "/minimatch",
20
+ "/mocha/minimatch"
20
21
  ],
21
22
  "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
22
23
  "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
@@ -2,7 +2,7 @@
2
2
  "_from": "concat-map@0.0.1",
3
3
  "_id": "concat-map@0.0.1",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
5
+ "_integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
6
6
  "_location": "/concat-map",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -2,7 +2,7 @@
2
2
  "_from": "console-control-strings@^1.1.0",
3
3
  "_id": "console-control-strings@1.1.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
5
+ "_integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
6
6
  "_location": "/console-control-strings",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -241,6 +241,9 @@ setInterval(function(){
241
241
  }, 1200);
242
242
  ```
243
243
 
244
+ In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
245
+
246
+ <img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
244
247
 
245
248
  ## Output streams
246
249
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "debug@4",
3
- "_id": "debug@4.3.3",
3
+ "_id": "debug@4.3.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
5
+ "_integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
6
6
  "_location": "/debug",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -19,8 +19,8 @@
19
19
  "/agent-base",
20
20
  "/https-proxy-agent"
21
21
  ],
22
- "_resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
23
- "_shasum": "04266e0b70a98d4462e6e288e38259213332b664",
22
+ "_resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
23
+ "_shasum": "1319f6579357f2338d3337d2cdd4914bb5dcc865",
24
24
  "_spec": "debug@4",
25
25
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/https-proxy-agent",
26
26
  "author": {
@@ -98,5 +98,5 @@
98
98
  "test:coverage": "cat ./coverage/lcov.info | coveralls",
99
99
  "test:node": "istanbul cover _mocha -- test.js"
100
100
  },
101
- "version": "4.3.3"
101
+ "version": "4.3.4"
102
102
  }
@@ -179,7 +179,7 @@ function setup(env) {
179
179
  namespaces = split[i].replace(/\*/g, '.*?');
180
180
 
181
181
  if (namespaces[0] === '-') {
182
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
182
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
183
183
  } else {
184
184
  createDebug.names.push(new RegExp('^' + namespaces + '$'));
185
185
  }
@@ -2,7 +2,7 @@
2
2
  "_from": "delegates@^1.0.0",
3
3
  "_id": "delegates@1.0.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
5
+ "_integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
6
6
  "_location": "/delegates",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -1,16 +1,15 @@
1
1
  # detect-libc
2
2
 
3
- Node.js module to detect the C standard library (libc) implementation
4
- family and version in use on a given Linux system.
3
+ Node.js module to detect details of the C standard library (libc)
4
+ implementation provided by a given Linux system.
5
5
 
6
- Provides a value suitable for use with the `LIBC` option of
7
- [prebuild](https://www.npmjs.com/package/prebuild),
8
- [prebuild-ci](https://www.npmjs.com/package/prebuild-ci) and
9
- [prebuild-install](https://www.npmjs.com/package/prebuild-install),
10
- therefore allowing build and provision of pre-compiled binaries
11
- for musl-based Linux e.g. Alpine as well as glibc-based.
6
+ Currently supports detection of GNU glibc and MUSL libc.
12
7
 
13
- Currently supports libc detection of `glibc` and `musl`.
8
+ Provides asychronous and synchronous functions for the
9
+ family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`).
10
+
11
+ For previous v1.x releases, please see the
12
+ [v1](https://github.com/lovell/detect-libc/tree/v1) branch.
14
13
 
15
14
  ## Install
16
15
 
@@ -18,54 +17,137 @@ Currently supports libc detection of `glibc` and `musl`.
18
17
  npm install detect-libc
19
18
  ```
20
19
 
21
- ## Usage
20
+ ## API
21
+
22
+ ### GLIBC
23
+
24
+ ```ts
25
+ const GLIBC: string = 'glibc';
26
+ ```
27
+
28
+ A String constant containing the value `glibc`.
29
+
30
+ ### MUSL
31
+
32
+ ```ts
33
+ const MUSL: string = 'musl';
34
+ ```
35
+
36
+ A String constant containing the value `musl`.
37
+
38
+ ### family
39
+
40
+ ```ts
41
+ function family(): Promise<string | null>;
42
+ ```
43
+
44
+ Resolves asychronously with:
22
45
 
23
- ### API
46
+ * `glibc` or `musl` when the libc family can be determined
47
+ * `null` when the libc family cannot be determined
48
+ * `null` when run on a non-Linux platform
24
49
 
25
50
  ```js
26
- const { GLIBC, MUSL, family, version, isNonGlibcLinux } = require('detect-libc');
51
+ const { family, GLIBC, MUSL } = require('detect-libc');
52
+
53
+ switch (await family()) {
54
+ case GLIBC: ...
55
+ case MUSL: ...
56
+ case null: ...
57
+ }
27
58
  ```
28
59
 
29
- * `GLIBC` is a String containing the value "glibc" for comparison with `family`.
30
- * `MUSL` is a String containing the value "musl" for comparison with `family`.
31
- * `family` is a String representing the system libc family.
32
- * `version` is a String representing the system libc version number.
33
- * `isNonGlibcLinux` is a Boolean representing whether the system is a non-glibc Linux, e.g. Alpine.
60
+ ### familySync
34
61
 
35
- ### detect-libc command line tool
62
+ ```ts
63
+ function familySync(): string | null;
64
+ ```
36
65
 
37
- When run on a Linux system with a non-glibc libc,
38
- the child command will be run with the `LIBC` environment variable
39
- set to the relevant value.
66
+ Synchronous version of `family()`.
40
67
 
41
- On all other platforms will run the child command as-is.
68
+ ```js
69
+ const { familySync, GLIBC, MUSL } = require('detect-libc');
42
70
 
43
- The command line feature requires `spawnSync` provided by Node v0.12+.
71
+ switch (familySync()) {
72
+ case GLIBC: ...
73
+ case MUSL: ...
74
+ case null: ...
75
+ }
76
+ ```
44
77
 
45
- ```sh
46
- detect-libc child-command
78
+ ### version
79
+
80
+ ```ts
81
+ function version(): Promise<string | null>;
82
+ ```
83
+
84
+ Resolves asychronously with:
85
+
86
+ * The version when it can be determined
87
+ * `null` when the libc family cannot be determined
88
+ * `null` when run on a non-Linux platform
89
+
90
+ ```js
91
+ const { version } = require('detect-libc');
92
+
93
+ const v = await version();
94
+ if (v) {
95
+ const [major, minor, patch] = v.split('.');
96
+ }
97
+ ```
98
+
99
+ ### versionSync
100
+
101
+ ```ts
102
+ function versionSync(): string | null;
103
+ ```
104
+
105
+ Synchronous version of `version()`.
106
+
107
+ ```js
108
+ const { versionSync } = require('detect-libc');
109
+
110
+ const v = versionSync();
111
+ if (v) {
112
+ const [major, minor, patch] = v.split('.');
113
+ }
114
+ ```
115
+
116
+ ### isNonGlibcLinux
117
+
118
+ ```ts
119
+ function isNonGlibcLinux(): Promise<boolean>;
47
120
  ```
48
121
 
49
- ## Integrating with prebuild
50
-
51
- ```json
52
- "scripts": {
53
- "install": "detect-libc prebuild-install || node-gyp rebuild",
54
- "test": "mocha && detect-libc prebuild-ci"
55
- },
56
- "dependencies": {
57
- "detect-libc": "^1.0.2",
58
- "prebuild-install": "^2.2.0"
59
- },
60
- "devDependencies": {
61
- "prebuild": "^6.2.1",
62
- "prebuild-ci": "^2.2.3"
63
- }
122
+ Resolves asychronously with:
123
+
124
+ * `false` when the libc family is `glibc`
125
+ * `true` when the libc family is not `glibc`
126
+ * `false` when run on a non-Linux platform
127
+
128
+ ```js
129
+ const { isNonGlibcLinux } = require('detect-libc');
130
+
131
+ if (await isNonGlibcLinux()) { ... }
132
+ ```
133
+
134
+ ### isNonGlibcLinuxSync
135
+
136
+ ```ts
137
+ function isNonGlibcLinuxSync(): boolean;
138
+ ```
139
+
140
+ Synchronous version of `isNonGlibcLinux()`.
141
+
142
+ ```js
143
+ const { isNonGlibcLinuxSync } = require('detect-libc');
144
+
145
+ if (isNonGlibcLinuxSync()) { ... }
64
146
  ```
65
147
 
66
- ## Licence
148
+ ## Licensing
67
149
 
68
- Copyright 2017 Lovell Fuller
150
+ Copyright 2017, 2022 Lovell Fuller
69
151
 
70
152
  Licensed under the Apache License, Version 2.0 (the "License");
71
153
  you may not use this file except in compliance with the License.
@@ -0,0 +1,11 @@
1
+ export const GLIBC: 'glibc';
2
+ export const MUSL: 'musl';
3
+
4
+ export function family(): Promise<string | null>;
5
+ export function familySync(): string | null;
6
+
7
+ export function isNonGlibcLinux(): Promise<boolean>;
8
+ export function isNonGlibcLinuxSync(): boolean;
9
+
10
+ export function version(): Promise<string | null>;
11
+ export function versionSync(): string | null;