node-datachannel 0.4.3 → 0.5.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.
- package/.github/workflows/build-linux.yml +10 -10
- package/.github/workflows/build-mac-m1.yml +5 -5
- package/.github/workflows/build-mac-x64.yml +5 -5
- package/.github/workflows/build-win.yml +11 -8
- package/.github/workflows/lint.yml +1 -1
- package/.github/workflows/npm-publish-manual.yml +1 -1
- package/{.prettierrc.js → .prettierrc.cjs} +1 -0
- package/BULDING.md +7 -3
- package/CMakeLists.txt +12 -22
- package/README.md +37 -33
- package/cmake/toolchain/arm64.cmake +1 -1
- package/examples/client-server/README.md +22 -0
- package/examples/client-server/client-benchmark.js +11 -6
- package/examples/client-server/client-periodic.js +5 -6
- package/examples/client-server/client.js +4 -5
- package/examples/client-server/package-lock.json +311 -260
- package/examples/client-server/package.json +15 -14
- package/examples/client-server/signaling-server.js +1 -2
- package/examples/electron-demo/README.md +58 -0
- package/examples/electron-demo/forge.config.js +49 -0
- package/examples/electron-demo/package-lock.json +16032 -0
- package/examples/electron-demo/package.json +43 -0
- package/examples/electron-demo/src/index.css +7 -0
- package/examples/electron-demo/src/index.html +29 -0
- package/examples/electron-demo/src/main.js +53 -0
- package/examples/electron-demo/src/node-datachannel.js +123 -0
- package/examples/electron-demo/src/preload.js +28 -0
- package/examples/electron-demo/src/renderer.js +58 -0
- package/examples/electron-demo/webpack.main.config.js +11 -0
- package/examples/electron-demo/webpack.renderer.config.js +13 -0
- package/examples/electron-demo/webpack.rules.js +35 -0
- package/examples/media/README.md +3 -3
- package/examples/media/media.js +3 -4
- package/examples/simple-peer-usage/main.js +28 -0
- package/examples/simple-peer-usage/package-lock.json +317 -0
- package/examples/simple-peer-usage/package.json +16 -0
- package/lib/datachannel-stream.js +3 -4
- package/lib/index.d.ts +12 -4
- package/lib/index.js +37 -3
- package/package.json +81 -68
- package/polyfill/Events.d.ts +9 -0
- package/polyfill/Events.js +27 -0
- package/polyfill/README.md +41 -0
- package/polyfill/RTCCertificate.d.ts +7 -0
- package/polyfill/RTCCertificate.js +17 -0
- package/polyfill/RTCDataChannel.d.ts +35 -0
- package/polyfill/RTCDataChannel.js +175 -0
- package/polyfill/RTCDtlsTransport.d.ts +10 -0
- package/polyfill/RTCDtlsTransport.js +47 -0
- package/polyfill/RTCIceCandidate.d.ts +20 -0
- package/polyfill/RTCIceCandidate.js +126 -0
- package/polyfill/RTCIceTransport.d.ts +18 -0
- package/polyfill/RTCIceTransport.js +82 -0
- package/polyfill/RTCPeerConnection.d.ts +50 -0
- package/polyfill/RTCPeerConnection.js +371 -0
- package/polyfill/RTCSctpTransport.d.ts +10 -0
- package/polyfill/RTCSctpTransport.js +53 -0
- package/polyfill/RTCSessionDescription.d.ts +7 -0
- package/polyfill/RTCSessionDescription.js +37 -0
- package/polyfill/index.d.ts +14 -0
- package/polyfill/index.js +14 -0
- package/src/data-channel-wrapper.cpp +47 -6
- package/src/main.cpp +5 -5
- package/src/peer-connection-wrapper.cpp +191 -9
- package/src/peer-connection-wrapper.h +6 -0
- package/src/rtc-wrapper.cpp +14 -9
- package/src/thread-safe-callback.cpp +4 -10
- package/src/thread-safe-callback.h +3 -12
- package/test/connectivity.js +9 -4
- package/test/polyfill-connectivity.js +90 -0
- package/test/test.js +2 -2
- package/test/wpt.js +50 -0
- package/examples/README.md +0 -21
- package/node_modules/ansi-regex/index.js +0 -4
- package/node_modules/ansi-regex/license +0 -21
- package/node_modules/ansi-regex/package.json +0 -111
- package/node_modules/ansi-regex/readme.md +0 -39
- package/node_modules/aproba/LICENSE +0 -14
- package/node_modules/aproba/README.md +0 -94
- package/node_modules/aproba/index.js +0 -105
- package/node_modules/aproba/package.json +0 -65
- package/node_modules/base64-js/LICENSE +0 -21
- package/node_modules/base64-js/README.md +0 -34
- package/node_modules/base64-js/base64js.min.js +0 -1
- package/node_modules/base64-js/index.d.ts +0 -3
- package/node_modules/base64-js/index.js +0 -150
- package/node_modules/base64-js/package.json +0 -78
- package/node_modules/buffer/AUTHORS.md +0 -70
- package/node_modules/buffer/LICENSE +0 -21
- package/node_modules/buffer/README.md +0 -410
- package/node_modules/buffer/index.d.ts +0 -186
- package/node_modules/buffer/index.js +0 -1817
- package/node_modules/buffer/package.json +0 -130
- package/node_modules/chownr/LICENSE +0 -15
- package/node_modules/chownr/README.md +0 -3
- package/node_modules/chownr/chownr.js +0 -167
- package/node_modules/chownr/package.json +0 -66
- package/node_modules/code-point-at/index.js +0 -32
- package/node_modules/code-point-at/license +0 -21
- package/node_modules/code-point-at/package.json +0 -73
- package/node_modules/code-point-at/readme.md +0 -32
- package/node_modules/console-control-strings/LICENSE +0 -13
- package/node_modules/console-control-strings/README.md +0 -145
- package/node_modules/console-control-strings/README.md~ +0 -140
- package/node_modules/console-control-strings/index.js +0 -125
- package/node_modules/console-control-strings/package.json +0 -64
- package/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/core-util-is/README.md +0 -3
- package/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/core-util-is/package.json +0 -70
- package/node_modules/core-util-is/test.js +0 -68
- package/node_modules/decompress-response/index.d.ts +0 -22
- package/node_modules/decompress-response/index.js +0 -58
- package/node_modules/decompress-response/license +0 -9
- package/node_modules/decompress-response/package.json +0 -91
- package/node_modules/decompress-response/readme.md +0 -48
- package/node_modules/deep-extend/CHANGELOG.md +0 -46
- package/node_modules/deep-extend/LICENSE +0 -20
- package/node_modules/deep-extend/README.md +0 -91
- package/node_modules/deep-extend/index.js +0 -1
- package/node_modules/deep-extend/lib/deep-extend.js +0 -150
- package/node_modules/deep-extend/package.json +0 -95
- package/node_modules/delegates/.npmignore +0 -1
- package/node_modules/delegates/History.md +0 -22
- package/node_modules/delegates/License +0 -20
- package/node_modules/delegates/Makefile +0 -8
- package/node_modules/delegates/Readme.md +0 -94
- package/node_modules/delegates/index.js +0 -121
- package/node_modules/delegates/package.json +0 -53
- package/node_modules/delegates/test/index.js +0 -94
- package/node_modules/detect-libc/LICENSE +0 -201
- package/node_modules/detect-libc/README.md +0 -160
- package/node_modules/detect-libc/index.d.ts +0 -11
- package/node_modules/detect-libc/lib/detect-libc.js +0 -178
- package/node_modules/detect-libc/lib/process.js +0 -16
- package/node_modules/detect-libc/package.json +0 -75
- package/node_modules/end-of-stream/LICENSE +0 -21
- package/node_modules/end-of-stream/README.md +0 -54
- package/node_modules/end-of-stream/index.js +0 -94
- package/node_modules/end-of-stream/package.json +0 -69
- package/node_modules/expand-template/.travis.yml +0 -6
- package/node_modules/expand-template/LICENSE +0 -21
- package/node_modules/expand-template/README.md +0 -43
- package/node_modules/expand-template/index.js +0 -26
- package/node_modules/expand-template/package.json +0 -63
- package/node_modules/expand-template/test.js +0 -67
- package/node_modules/fs-constants/LICENSE +0 -21
- package/node_modules/fs-constants/README.md +0 -26
- package/node_modules/fs-constants/browser.js +0 -1
- package/node_modules/fs-constants/index.js +0 -1
- package/node_modules/fs-constants/package.json +0 -50
- package/node_modules/github-from-package/.travis.yml +0 -4
- package/node_modules/github-from-package/LICENSE +0 -18
- package/node_modules/github-from-package/example/package.json +0 -8
- package/node_modules/github-from-package/example/url.js +0 -3
- package/node_modules/github-from-package/index.js +0 -17
- package/node_modules/github-from-package/package.json +0 -62
- package/node_modules/github-from-package/readme.markdown +0 -53
- package/node_modules/github-from-package/test/a.json +0 -8
- package/node_modules/github-from-package/test/b.json +0 -5
- package/node_modules/github-from-package/test/c.json +0 -5
- package/node_modules/github-from-package/test/d.json +0 -7
- package/node_modules/github-from-package/test/e.json +0 -5
- package/node_modules/github-from-package/test/url.js +0 -19
- package/node_modules/has-unicode/LICENSE +0 -14
- package/node_modules/has-unicode/README.md +0 -43
- package/node_modules/has-unicode/index.js +0 -16
- package/node_modules/has-unicode/package.json +0 -62
- package/node_modules/ieee754/LICENSE +0 -11
- package/node_modules/ieee754/README.md +0 -51
- package/node_modules/ieee754/index.d.ts +0 -10
- package/node_modules/ieee754/index.js +0 -85
- package/node_modules/ieee754/package.json +0 -87
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -78
- package/node_modules/ini/LICENSE +0 -15
- package/node_modules/ini/README.md +0 -102
- package/node_modules/ini/ini.js +0 -206
- package/node_modules/ini/package.json +0 -69
- package/node_modules/is-fullwidth-code-point/index.js +0 -46
- package/node_modules/is-fullwidth-code-point/license +0 -21
- package/node_modules/is-fullwidth-code-point/package.json +0 -80
- package/node_modules/is-fullwidth-code-point/readme.md +0 -39
- package/node_modules/isarray/.npmignore +0 -1
- package/node_modules/isarray/.travis.yml +0 -4
- package/node_modules/isarray/Makefile +0 -6
- package/node_modules/isarray/README.md +0 -60
- package/node_modules/isarray/component.json +0 -19
- package/node_modules/isarray/index.js +0 -5
- package/node_modules/isarray/package.json +0 -77
- package/node_modules/isarray/test.js +0 -20
- package/node_modules/lru-cache/LICENSE +0 -15
- package/node_modules/lru-cache/README.md +0 -166
- package/node_modules/lru-cache/index.js +0 -334
- package/node_modules/lru-cache/node_modules/yallist/LICENSE +0 -15
- package/node_modules/lru-cache/node_modules/yallist/README.md +0 -204
- package/node_modules/lru-cache/node_modules/yallist/iterator.js +0 -8
- package/node_modules/lru-cache/node_modules/yallist/package.json +0 -65
- package/node_modules/lru-cache/node_modules/yallist/yallist.js +0 -426
- package/node_modules/lru-cache/package.json +0 -73
- package/node_modules/mimic-response/index.d.ts +0 -17
- package/node_modules/mimic-response/index.js +0 -77
- package/node_modules/mimic-response/license +0 -9
- package/node_modules/mimic-response/package.json +0 -77
- package/node_modules/mimic-response/readme.md +0 -78
- package/node_modules/minimist/.travis.yml +0 -8
- package/node_modules/minimist/LICENSE +0 -18
- package/node_modules/minimist/example/parse.js +0 -2
- package/node_modules/minimist/index.js +0 -249
- package/node_modules/minimist/package.json +0 -79
- package/node_modules/minimist/readme.markdown +0 -98
- package/node_modules/minimist/test/all_bool.js +0 -32
- package/node_modules/minimist/test/bool.js +0 -178
- package/node_modules/minimist/test/dash.js +0 -31
- package/node_modules/minimist/test/default_bool.js +0 -35
- package/node_modules/minimist/test/dotted.js +0 -22
- package/node_modules/minimist/test/kv_short.js +0 -16
- package/node_modules/minimist/test/long.js +0 -31
- package/node_modules/minimist/test/num.js +0 -36
- package/node_modules/minimist/test/parse.js +0 -197
- package/node_modules/minimist/test/parse_modified.js +0 -9
- package/node_modules/minimist/test/proto.js +0 -60
- package/node_modules/minimist/test/short.js +0 -67
- package/node_modules/minimist/test/stop_early.js +0 -15
- package/node_modules/minimist/test/unknown.js +0 -102
- package/node_modules/minimist/test/whitespace.js +0 -8
- package/node_modules/mkdirp-classic/LICENSE +0 -21
- package/node_modules/mkdirp-classic/README.md +0 -18
- package/node_modules/mkdirp-classic/index.js +0 -98
- package/node_modules/mkdirp-classic/package.json +0 -50
- package/node_modules/napi-build-utils/LICENSE +0 -21
- package/node_modules/napi-build-utils/README.md +0 -48
- package/node_modules/napi-build-utils/index.js +0 -213
- package/node_modules/napi-build-utils/index.md +0 -81
- package/node_modules/napi-build-utils/package.json +0 -72
- package/node_modules/node-abi/.circleci/config.yml +0 -63
- package/node_modules/node-abi/.github/workflows/update-abi.yml +0 -41
- package/node_modules/node-abi/.releaserc.json +0 -9
- package/node_modules/node-abi/CODE_OF_CONDUCT.md +0 -73
- package/node_modules/node-abi/CONTRIBUTING.md +0 -53
- package/node_modules/node-abi/LICENSE +0 -21
- package/node_modules/node-abi/README.md +0 -50
- package/node_modules/node-abi/abi_registry.json +0 -186
- package/node_modules/node-abi/index.js +0 -179
- package/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
- package/node_modules/node-abi/node_modules/semver/README.md +0 -568
- package/node_modules/node-abi/node_modules/semver/bin/semver.js +0 -183
- package/node_modules/node-abi/node_modules/semver/classes/comparator.js +0 -136
- package/node_modules/node-abi/node_modules/semver/classes/index.js +0 -5
- package/node_modules/node-abi/node_modules/semver/classes/range.js +0 -519
- package/node_modules/node-abi/node_modules/semver/classes/semver.js +0 -287
- package/node_modules/node-abi/node_modules/semver/functions/clean.js +0 -6
- package/node_modules/node-abi/node_modules/semver/functions/cmp.js +0 -52
- package/node_modules/node-abi/node_modules/semver/functions/coerce.js +0 -52
- package/node_modules/node-abi/node_modules/semver/functions/compare-build.js +0 -7
- package/node_modules/node-abi/node_modules/semver/functions/compare-loose.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/compare.js +0 -5
- package/node_modules/node-abi/node_modules/semver/functions/diff.js +0 -23
- package/node_modules/node-abi/node_modules/semver/functions/eq.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/gt.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/gte.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/inc.js +0 -18
- package/node_modules/node-abi/node_modules/semver/functions/lt.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/lte.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/major.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/minor.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/neq.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/parse.js +0 -33
- package/node_modules/node-abi/node_modules/semver/functions/patch.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/prerelease.js +0 -6
- package/node_modules/node-abi/node_modules/semver/functions/rcompare.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/rsort.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/satisfies.js +0 -10
- package/node_modules/node-abi/node_modules/semver/functions/sort.js +0 -3
- package/node_modules/node-abi/node_modules/semver/functions/valid.js +0 -6
- package/node_modules/node-abi/node_modules/semver/index.js +0 -48
- package/node_modules/node-abi/node_modules/semver/internal/constants.js +0 -17
- package/node_modules/node-abi/node_modules/semver/internal/debug.js +0 -9
- package/node_modules/node-abi/node_modules/semver/internal/identifiers.js +0 -23
- package/node_modules/node-abi/node_modules/semver/internal/parse-options.js +0 -11
- package/node_modules/node-abi/node_modules/semver/internal/re.js +0 -182
- package/node_modules/node-abi/node_modules/semver/package.json +0 -109
- package/node_modules/node-abi/node_modules/semver/preload.js +0 -2
- package/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
- package/node_modules/node-abi/node_modules/semver/ranges/gtr.js +0 -4
- package/node_modules/node-abi/node_modules/semver/ranges/intersects.js +0 -7
- package/node_modules/node-abi/node_modules/semver/ranges/ltr.js +0 -4
- package/node_modules/node-abi/node_modules/semver/ranges/max-satisfying.js +0 -25
- package/node_modules/node-abi/node_modules/semver/ranges/min-satisfying.js +0 -24
- package/node_modules/node-abi/node_modules/semver/ranges/min-version.js +0 -61
- package/node_modules/node-abi/node_modules/semver/ranges/outside.js +0 -80
- package/node_modules/node-abi/node_modules/semver/ranges/simplify.js +0 -47
- package/node_modules/node-abi/node_modules/semver/ranges/subset.js +0 -244
- package/node_modules/node-abi/node_modules/semver/ranges/to-comparators.js +0 -8
- package/node_modules/node-abi/node_modules/semver/ranges/valid.js +0 -11
- package/node_modules/node-abi/package.json +0 -72
- package/node_modules/node-abi/scripts/update-abi-registry.js +0 -119
- package/node_modules/node-abi/test/index.js +0 -166
- package/node_modules/npmlog/CHANGELOG.md +0 -49
- package/node_modules/npmlog/LICENSE +0 -15
- package/node_modules/npmlog/README.md +0 -216
- package/node_modules/npmlog/log.js +0 -309
- package/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md +0 -37
- package/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE +0 -5
- package/node_modules/npmlog/node_modules/are-we-there-yet/README.md +0 -195
- package/node_modules/npmlog/node_modules/are-we-there-yet/index.js +0 -4
- package/node_modules/npmlog/node_modules/are-we-there-yet/package.json +0 -66
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js +0 -11
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js +0 -107
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js +0 -36
- package/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js +0 -30
- package/node_modules/npmlog/node_modules/gauge/CHANGELOG.md +0 -160
- package/node_modules/npmlog/node_modules/gauge/LICENSE +0 -13
- package/node_modules/npmlog/node_modules/gauge/README.md +0 -399
- package/node_modules/npmlog/node_modules/gauge/base-theme.js +0 -14
- package/node_modules/npmlog/node_modules/gauge/error.js +0 -24
- package/node_modules/npmlog/node_modules/gauge/has-color.js +0 -12
- package/node_modules/npmlog/node_modules/gauge/index.js +0 -233
- package/node_modules/npmlog/node_modules/gauge/package.json +0 -94
- package/node_modules/npmlog/node_modules/gauge/plumbing.js +0 -48
- package/node_modules/npmlog/node_modules/gauge/process.js +0 -3
- package/node_modules/npmlog/node_modules/gauge/progress-bar.js +0 -35
- package/node_modules/npmlog/node_modules/gauge/render-template.js +0 -181
- package/node_modules/npmlog/node_modules/gauge/set-immediate.js +0 -7
- package/node_modules/npmlog/node_modules/gauge/set-interval.js +0 -3
- package/node_modules/npmlog/node_modules/gauge/spin.js +0 -5
- package/node_modules/npmlog/node_modules/gauge/template-item.js +0 -73
- package/node_modules/npmlog/node_modules/gauge/theme-set.js +0 -115
- package/node_modules/npmlog/node_modules/gauge/themes.js +0 -54
- package/node_modules/npmlog/node_modules/gauge/wide-truncate.js +0 -25
- package/node_modules/npmlog/package.json +0 -78
- package/node_modules/number-is-nan/index.js +0 -4
- package/node_modules/number-is-nan/license +0 -21
- package/node_modules/number-is-nan/package.json +0 -70
- package/node_modules/number-is-nan/readme.md +0 -28
- package/node_modules/object-assign/index.js +0 -90
- package/node_modules/object-assign/license +0 -21
- package/node_modules/object-assign/package.json +0 -77
- package/node_modules/object-assign/readme.md +0 -61
- package/node_modules/once/LICENSE +0 -15
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -74
- package/node_modules/prebuild-install/CHANGELOG.md +0 -98
- package/node_modules/prebuild-install/CONTRIBUTING.md +0 -6
- package/node_modules/prebuild-install/LICENSE +0 -21
- package/node_modules/prebuild-install/README.md +0 -159
- package/node_modules/prebuild-install/asset.js +0 -44
- package/node_modules/prebuild-install/bin.js +0 -78
- package/node_modules/prebuild-install/download.js +0 -142
- package/node_modules/prebuild-install/error.js +0 -14
- package/node_modules/prebuild-install/help.txt +0 -16
- package/node_modules/prebuild-install/index.js +0 -1
- package/node_modules/prebuild-install/log.js +0 -25
- package/node_modules/prebuild-install/package.json +0 -129
- package/node_modules/prebuild-install/proxy.js +0 -35
- package/node_modules/prebuild-install/rc.js +0 -60
- package/node_modules/prebuild-install/util.js +0 -143
- package/node_modules/process-nextick-args/index.js +0 -45
- package/node_modules/process-nextick-args/license.md +0 -19
- package/node_modules/process-nextick-args/package.json +0 -53
- package/node_modules/process-nextick-args/readme.md +0 -18
- package/node_modules/pump/.travis.yml +0 -5
- package/node_modules/pump/LICENSE +0 -21
- package/node_modules/pump/README.md +0 -65
- package/node_modules/pump/index.js +0 -82
- package/node_modules/pump/package.json +0 -63
- package/node_modules/pump/test-browser.js +0 -66
- package/node_modules/pump/test-node.js +0 -53
- package/node_modules/rc/LICENSE.APACHE2 +0 -15
- package/node_modules/rc/LICENSE.BSD +0 -26
- package/node_modules/rc/LICENSE.MIT +0 -24
- package/node_modules/rc/README.md +0 -227
- package/node_modules/rc/browser.js +0 -7
- package/node_modules/rc/cli.js +0 -4
- package/node_modules/rc/index.js +0 -53
- package/node_modules/rc/lib/utils.js +0 -104
- package/node_modules/rc/package.json +0 -70
- package/node_modules/rc/test/ini.js +0 -16
- package/node_modules/rc/test/nested-env-vars.js +0 -50
- package/node_modules/rc/test/test.js +0 -59
- package/node_modules/readable-stream/.travis.yml +0 -34
- package/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/readable-stream/README.md +0 -58
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -60
- package/node_modules/readable-stream/duplex-browser.js +0 -1
- package/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/readable-stream/lib/_stream_duplex.js +0 -131
- package/node_modules/readable-stream/lib/_stream_passthrough.js +0 -47
- package/node_modules/readable-stream/lib/_stream_readable.js +0 -1019
- package/node_modules/readable-stream/lib/_stream_transform.js +0 -214
- package/node_modules/readable-stream/lib/_stream_writable.js +0 -687
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +0 -79
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -74
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/readable-stream/package.json +0 -87
- package/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/readable-stream/readable-browser.js +0 -7
- package/node_modules/readable-stream/readable.js +0 -19
- package/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/readable-stream/writable-browser.js +0 -1
- package/node_modules/readable-stream/writable.js +0 -8
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -62
- package/node_modules/safe-buffer/package.json +0 -70
- package/node_modules/set-blocking/CHANGELOG.md +0 -26
- package/node_modules/set-blocking/LICENSE.txt +0 -14
- package/node_modules/set-blocking/README.md +0 -31
- package/node_modules/set-blocking/index.js +0 -7
- package/node_modules/set-blocking/package.json +0 -73
- package/node_modules/signal-exit/CHANGELOG.md +0 -35
- package/node_modules/signal-exit/LICENSE.txt +0 -16
- package/node_modules/signal-exit/README.md +0 -39
- package/node_modules/signal-exit/index.js +0 -163
- package/node_modules/signal-exit/package.json +0 -71
- package/node_modules/signal-exit/signals.js +0 -53
- package/node_modules/simple-concat/.travis.yml +0 -3
- package/node_modules/simple-concat/LICENSE +0 -20
- package/node_modules/simple-concat/README.md +0 -44
- package/node_modules/simple-concat/index.js +0 -15
- package/node_modules/simple-concat/package.json +0 -75
- package/node_modules/simple-concat/test/basic.js +0 -41
- package/node_modules/simple-get/.github/dependabot.yml +0 -15
- package/node_modules/simple-get/.github/workflows/ci.yml +0 -23
- package/node_modules/simple-get/LICENSE +0 -20
- package/node_modules/simple-get/README.md +0 -333
- package/node_modules/simple-get/index.js +0 -108
- package/node_modules/simple-get/package.json +0 -95
- package/node_modules/string-width/index.js +0 -37
- package/node_modules/string-width/license +0 -21
- package/node_modules/string-width/package.json +0 -95
- package/node_modules/string-width/readme.md +0 -42
- package/node_modules/string_decoder/.travis.yml +0 -50
- package/node_modules/string_decoder/LICENSE +0 -48
- package/node_modules/string_decoder/README.md +0 -47
- package/node_modules/string_decoder/lib/string_decoder.js +0 -296
- package/node_modules/string_decoder/package.json +0 -64
- package/node_modules/strip-ansi/index.js +0 -6
- package/node_modules/strip-ansi/license +0 -21
- package/node_modules/strip-ansi/package.json +0 -107
- package/node_modules/strip-ansi/readme.md +0 -33
- package/node_modules/strip-json-comments/index.js +0 -70
- package/node_modules/strip-json-comments/license +0 -21
- package/node_modules/strip-json-comments/package.json +0 -77
- package/node_modules/strip-json-comments/readme.md +0 -64
- package/node_modules/tar-fs/.travis.yml +0 -6
- package/node_modules/tar-fs/LICENSE +0 -21
- package/node_modules/tar-fs/README.md +0 -165
- package/node_modules/tar-fs/index.js +0 -351
- package/node_modules/tar-fs/package.json +0 -71
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +0 -1
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +0 -1
- package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/node_modules/tar-fs/test/index.js +0 -346
- package/node_modules/tar-stream/LICENSE +0 -21
- package/node_modules/tar-stream/README.md +0 -168
- package/node_modules/tar-stream/extract.js +0 -257
- package/node_modules/tar-stream/headers.js +0 -293
- package/node_modules/tar-stream/index.js +0 -2
- package/node_modules/tar-stream/node_modules/bl/.travis.yml +0 -17
- package/node_modules/tar-stream/node_modules/bl/BufferList.js +0 -396
- package/node_modules/tar-stream/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/tar-stream/node_modules/bl/README.md +0 -247
- package/node_modules/tar-stream/node_modules/bl/bl.js +0 -84
- package/node_modules/tar-stream/node_modules/bl/package.json +0 -68
- package/node_modules/tar-stream/node_modules/bl/test/convert.js +0 -21
- package/node_modules/tar-stream/node_modules/bl/test/indexOf.js +0 -492
- package/node_modules/tar-stream/node_modules/bl/test/isBufferList.js +0 -32
- package/node_modules/tar-stream/node_modules/bl/test/test.js +0 -869
- package/node_modules/tar-stream/node_modules/readable-stream/CONTRIBUTING.md +0 -38
- package/node_modules/tar-stream/node_modules/readable-stream/GOVERNANCE.md +0 -136
- package/node_modules/tar-stream/node_modules/readable-stream/LICENSE +0 -47
- package/node_modules/tar-stream/node_modules/readable-stream/README.md +0 -106
- package/node_modules/tar-stream/node_modules/readable-stream/errors-browser.js +0 -127
- package/node_modules/tar-stream/node_modules/readable-stream/errors.js +0 -116
- package/node_modules/tar-stream/node_modules/readable-stream/experimentalWarning.js +0 -17
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_duplex.js +0 -139
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_passthrough.js +0 -39
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_readable.js +0 -1124
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_transform.js +0 -201
- package/node_modules/tar-stream/node_modules/readable-stream/lib/_stream_writable.js +0 -697
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +0 -207
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +0 -210
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +0 -105
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +0 -104
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js +0 -3
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/from.js +0 -64
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +0 -97
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/state.js +0 -27
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js +0 -1
- package/node_modules/tar-stream/node_modules/readable-stream/lib/internal/streams/stream.js +0 -1
- package/node_modules/tar-stream/node_modules/readable-stream/package.json +0 -101
- package/node_modules/tar-stream/node_modules/readable-stream/readable-browser.js +0 -9
- package/node_modules/tar-stream/node_modules/readable-stream/readable.js +0 -16
- package/node_modules/tar-stream/pack.js +0 -255
- package/node_modules/tar-stream/package.json +0 -95
- package/node_modules/tar-stream/sandbox.js +0 -11
- package/node_modules/tunnel-agent/LICENSE +0 -55
- package/node_modules/tunnel-agent/README.md +0 -4
- package/node_modules/tunnel-agent/index.js +0 -244
- package/node_modules/tunnel-agent/package.json +0 -59
- package/node_modules/util-deprecate/History.md +0 -16
- package/node_modules/util-deprecate/LICENSE +0 -24
- package/node_modules/util-deprecate/README.md +0 -53
- package/node_modules/util-deprecate/browser.js +0 -67
- package/node_modules/util-deprecate/node.js +0 -6
- package/node_modules/util-deprecate/package.json +0 -62
- package/node_modules/wide-align/LICENSE +0 -14
- package/node_modules/wide-align/README.md +0 -47
- package/node_modules/wide-align/align.js +0 -65
- package/node_modules/wide-align/package.json +0 -69
- package/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -62
- package/node_modules/wrappy/wrappy.js +0 -33
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var parse = require('../');
|
|
2
|
-
var test = require('tape');
|
|
3
|
-
|
|
4
|
-
test('proto pollution', function (t) {
|
|
5
|
-
var argv = parse(['--__proto__.x','123']);
|
|
6
|
-
t.equal({}.x, undefined);
|
|
7
|
-
t.equal(argv.__proto__.x, undefined);
|
|
8
|
-
t.equal(argv.x, undefined);
|
|
9
|
-
t.end();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('proto pollution (array)', function (t) {
|
|
13
|
-
var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']);
|
|
14
|
-
t.equal({}.z, undefined);
|
|
15
|
-
t.deepEqual(argv.x, [4,5]);
|
|
16
|
-
t.equal(argv.x.z, undefined);
|
|
17
|
-
t.equal(argv.x.__proto__.z, undefined);
|
|
18
|
-
t.end();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test('proto pollution (number)', function (t) {
|
|
22
|
-
var argv = parse(['--x','5','--x.__proto__.z','100']);
|
|
23
|
-
t.equal({}.z, undefined);
|
|
24
|
-
t.equal((4).z, undefined);
|
|
25
|
-
t.equal(argv.x, 5);
|
|
26
|
-
t.equal(argv.x.z, undefined);
|
|
27
|
-
t.end();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test('proto pollution (string)', function (t) {
|
|
31
|
-
var argv = parse(['--x','abc','--x.__proto__.z','def']);
|
|
32
|
-
t.equal({}.z, undefined);
|
|
33
|
-
t.equal('...'.z, undefined);
|
|
34
|
-
t.equal(argv.x, 'abc');
|
|
35
|
-
t.equal(argv.x.z, undefined);
|
|
36
|
-
t.end();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test('proto pollution (constructor)', function (t) {
|
|
40
|
-
var argv = parse(['--constructor.prototype.y','123']);
|
|
41
|
-
t.equal({}.y, undefined);
|
|
42
|
-
t.equal(argv.y, undefined);
|
|
43
|
-
t.end();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
test('proto pollution (constructor function)', function (t) {
|
|
47
|
-
var argv = parse(['--_.concat.constructor.prototype.y', '123']);
|
|
48
|
-
function fnToBeTested() {}
|
|
49
|
-
t.equal(fnToBeTested.y, undefined);
|
|
50
|
-
t.equal(argv.y, undefined);
|
|
51
|
-
t.end();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// powered by snyk - https://github.com/backstage/backstage/issues/10343
|
|
55
|
-
test('proto pollution (constructor function) snyk', function (t) {
|
|
56
|
-
var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' '));
|
|
57
|
-
t.equal((function(){}).foo, undefined);
|
|
58
|
-
t.equal(argv.y, undefined);
|
|
59
|
-
t.end();
|
|
60
|
-
})
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var parse = require('../');
|
|
2
|
-
var test = require('tape');
|
|
3
|
-
|
|
4
|
-
test('numeric short args', function (t) {
|
|
5
|
-
t.plan(2);
|
|
6
|
-
t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });
|
|
7
|
-
t.deepEqual(
|
|
8
|
-
parse([ '-123', '456' ]),
|
|
9
|
-
{ 1: true, 2: true, 3: 456, _: [] }
|
|
10
|
-
);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test('short', function (t) {
|
|
14
|
-
t.deepEqual(
|
|
15
|
-
parse([ '-b' ]),
|
|
16
|
-
{ b : true, _ : [] },
|
|
17
|
-
'short boolean'
|
|
18
|
-
);
|
|
19
|
-
t.deepEqual(
|
|
20
|
-
parse([ 'foo', 'bar', 'baz' ]),
|
|
21
|
-
{ _ : [ 'foo', 'bar', 'baz' ] },
|
|
22
|
-
'bare'
|
|
23
|
-
);
|
|
24
|
-
t.deepEqual(
|
|
25
|
-
parse([ '-cats' ]),
|
|
26
|
-
{ c : true, a : true, t : true, s : true, _ : [] },
|
|
27
|
-
'group'
|
|
28
|
-
);
|
|
29
|
-
t.deepEqual(
|
|
30
|
-
parse([ '-cats', 'meow' ]),
|
|
31
|
-
{ c : true, a : true, t : true, s : 'meow', _ : [] },
|
|
32
|
-
'short group next'
|
|
33
|
-
);
|
|
34
|
-
t.deepEqual(
|
|
35
|
-
parse([ '-h', 'localhost' ]),
|
|
36
|
-
{ h : 'localhost', _ : [] },
|
|
37
|
-
'short capture'
|
|
38
|
-
);
|
|
39
|
-
t.deepEqual(
|
|
40
|
-
parse([ '-h', 'localhost', '-p', '555' ]),
|
|
41
|
-
{ h : 'localhost', p : 555, _ : [] },
|
|
42
|
-
'short captures'
|
|
43
|
-
);
|
|
44
|
-
t.end();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test('mixed short bool and capture', function (t) {
|
|
48
|
-
t.same(
|
|
49
|
-
parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
|
|
50
|
-
{
|
|
51
|
-
f : true, p : 555, h : 'localhost',
|
|
52
|
-
_ : [ 'script.js' ]
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
t.end();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('short and long', function (t) {
|
|
59
|
-
t.deepEqual(
|
|
60
|
-
parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
|
|
61
|
-
{
|
|
62
|
-
f : true, p : 555, h : 'localhost',
|
|
63
|
-
_ : [ 'script.js' ]
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
t.end();
|
|
67
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var parse = require('../');
|
|
2
|
-
var test = require('tape');
|
|
3
|
-
|
|
4
|
-
test('stops parsing on the first non-option when stopEarly is set', function (t) {
|
|
5
|
-
var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
|
|
6
|
-
stopEarly: true
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
t.deepEqual(argv, {
|
|
10
|
-
aaa: 'bbb',
|
|
11
|
-
_: ['ccc', '--ddd']
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
t.end();
|
|
15
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
var parse = require('../');
|
|
2
|
-
var test = require('tape');
|
|
3
|
-
|
|
4
|
-
test('boolean and alias is not unknown', function (t) {
|
|
5
|
-
var unknown = [];
|
|
6
|
-
function unknownFn(arg) {
|
|
7
|
-
unknown.push(arg);
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
var aliased = [ '-h', 'true', '--derp', 'true' ];
|
|
11
|
-
var regular = [ '--herp', 'true', '-d', 'true' ];
|
|
12
|
-
var opts = {
|
|
13
|
-
alias: { h: 'herp' },
|
|
14
|
-
boolean: 'h',
|
|
15
|
-
unknown: unknownFn
|
|
16
|
-
};
|
|
17
|
-
var aliasedArgv = parse(aliased, opts);
|
|
18
|
-
var propertyArgv = parse(regular, opts);
|
|
19
|
-
|
|
20
|
-
t.same(unknown, ['--derp', '-d']);
|
|
21
|
-
t.end();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test('flag boolean true any double hyphen argument is not unknown', function (t) {
|
|
25
|
-
var unknown = [];
|
|
26
|
-
function unknownFn(arg) {
|
|
27
|
-
unknown.push(arg);
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], {
|
|
31
|
-
boolean: true,
|
|
32
|
-
unknown: unknownFn
|
|
33
|
-
});
|
|
34
|
-
t.same(unknown, ['--tacos=good', 'cow', '-p']);
|
|
35
|
-
t.same(argv, {
|
|
36
|
-
honk: true,
|
|
37
|
-
_: []
|
|
38
|
-
});
|
|
39
|
-
t.end();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('string and alias is not unknown', function (t) {
|
|
43
|
-
var unknown = [];
|
|
44
|
-
function unknownFn(arg) {
|
|
45
|
-
unknown.push(arg);
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
var aliased = [ '-h', 'hello', '--derp', 'goodbye' ];
|
|
49
|
-
var regular = [ '--herp', 'hello', '-d', 'moon' ];
|
|
50
|
-
var opts = {
|
|
51
|
-
alias: { h: 'herp' },
|
|
52
|
-
string: 'h',
|
|
53
|
-
unknown: unknownFn
|
|
54
|
-
};
|
|
55
|
-
var aliasedArgv = parse(aliased, opts);
|
|
56
|
-
var propertyArgv = parse(regular, opts);
|
|
57
|
-
|
|
58
|
-
t.same(unknown, ['--derp', '-d']);
|
|
59
|
-
t.end();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test('default and alias is not unknown', function (t) {
|
|
63
|
-
var unknown = [];
|
|
64
|
-
function unknownFn(arg) {
|
|
65
|
-
unknown.push(arg);
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
var aliased = [ '-h', 'hello' ];
|
|
69
|
-
var regular = [ '--herp', 'hello' ];
|
|
70
|
-
var opts = {
|
|
71
|
-
default: { 'h': 'bar' },
|
|
72
|
-
alias: { 'h': 'herp' },
|
|
73
|
-
unknown: unknownFn
|
|
74
|
-
};
|
|
75
|
-
var aliasedArgv = parse(aliased, opts);
|
|
76
|
-
var propertyArgv = parse(regular, opts);
|
|
77
|
-
|
|
78
|
-
t.same(unknown, []);
|
|
79
|
-
t.end();
|
|
80
|
-
unknownFn(); // exercise fn for 100% coverage
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test('value following -- is not unknown', function (t) {
|
|
84
|
-
var unknown = [];
|
|
85
|
-
function unknownFn(arg) {
|
|
86
|
-
unknown.push(arg);
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
var aliased = [ '--bad', '--', 'good', 'arg' ];
|
|
90
|
-
var opts = {
|
|
91
|
-
'--': true,
|
|
92
|
-
unknown: unknownFn
|
|
93
|
-
};
|
|
94
|
-
var argv = parse(aliased, opts);
|
|
95
|
-
|
|
96
|
-
t.same(unknown, ['--bad']);
|
|
97
|
-
t.same(argv, {
|
|
98
|
-
'--': ['good', 'arg'],
|
|
99
|
-
'_': []
|
|
100
|
-
})
|
|
101
|
-
t.end();
|
|
102
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 James Halliday (mail@substack.net) and Mathias Buus
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# mkdirp-classic
|
|
2
|
-
|
|
3
|
-
Just a non-deprecated mirror of [mkdirp 0.5.2](https://github.com/substack/node-mkdirp/tree/0.5.1)
|
|
4
|
-
for use in modules where we depend on the non promise interface.
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
npm install mkdirp-classic
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
``` js
|
|
13
|
-
// See the above link
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## License
|
|
17
|
-
|
|
18
|
-
MIT
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var path = require('path');
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
var _0777 = parseInt('0777', 8);
|
|
4
|
-
|
|
5
|
-
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
|
|
6
|
-
|
|
7
|
-
function mkdirP (p, opts, f, made) {
|
|
8
|
-
if (typeof opts === 'function') {
|
|
9
|
-
f = opts;
|
|
10
|
-
opts = {};
|
|
11
|
-
}
|
|
12
|
-
else if (!opts || typeof opts !== 'object') {
|
|
13
|
-
opts = { mode: opts };
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
var mode = opts.mode;
|
|
17
|
-
var xfs = opts.fs || fs;
|
|
18
|
-
|
|
19
|
-
if (mode === undefined) {
|
|
20
|
-
mode = _0777 & (~process.umask());
|
|
21
|
-
}
|
|
22
|
-
if (!made) made = null;
|
|
23
|
-
|
|
24
|
-
var cb = f || function () {};
|
|
25
|
-
p = path.resolve(p);
|
|
26
|
-
|
|
27
|
-
xfs.mkdir(p, mode, function (er) {
|
|
28
|
-
if (!er) {
|
|
29
|
-
made = made || p;
|
|
30
|
-
return cb(null, made);
|
|
31
|
-
}
|
|
32
|
-
switch (er.code) {
|
|
33
|
-
case 'ENOENT':
|
|
34
|
-
mkdirP(path.dirname(p), opts, function (er, made) {
|
|
35
|
-
if (er) cb(er, made);
|
|
36
|
-
else mkdirP(p, opts, cb, made);
|
|
37
|
-
});
|
|
38
|
-
break;
|
|
39
|
-
|
|
40
|
-
// In the case of any other error, just see if there's a dir
|
|
41
|
-
// there already. If so, then hooray! If not, then something
|
|
42
|
-
// is borked.
|
|
43
|
-
default:
|
|
44
|
-
xfs.stat(p, function (er2, stat) {
|
|
45
|
-
// if the stat fails, then that's super weird.
|
|
46
|
-
// let the original error be the failure reason.
|
|
47
|
-
if (er2 || !stat.isDirectory()) cb(er, made)
|
|
48
|
-
else cb(null, made);
|
|
49
|
-
});
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
mkdirP.sync = function sync (p, opts, made) {
|
|
56
|
-
if (!opts || typeof opts !== 'object') {
|
|
57
|
-
opts = { mode: opts };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
var mode = opts.mode;
|
|
61
|
-
var xfs = opts.fs || fs;
|
|
62
|
-
|
|
63
|
-
if (mode === undefined) {
|
|
64
|
-
mode = _0777 & (~process.umask());
|
|
65
|
-
}
|
|
66
|
-
if (!made) made = null;
|
|
67
|
-
|
|
68
|
-
p = path.resolve(p);
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
xfs.mkdirSync(p, mode);
|
|
72
|
-
made = made || p;
|
|
73
|
-
}
|
|
74
|
-
catch (err0) {
|
|
75
|
-
switch (err0.code) {
|
|
76
|
-
case 'ENOENT' :
|
|
77
|
-
made = sync(path.dirname(p), opts, made);
|
|
78
|
-
sync(p, opts, made);
|
|
79
|
-
break;
|
|
80
|
-
|
|
81
|
-
// In the case of any other error, just see if there's a dir
|
|
82
|
-
// there already. If so, then hooray! If not, then something
|
|
83
|
-
// is borked.
|
|
84
|
-
default:
|
|
85
|
-
var stat;
|
|
86
|
-
try {
|
|
87
|
-
stat = xfs.statSync(p);
|
|
88
|
-
}
|
|
89
|
-
catch (err1) {
|
|
90
|
-
throw err0;
|
|
91
|
-
}
|
|
92
|
-
if (!stat.isDirectory()) throw err0;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return made;
|
|
98
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_args": [
|
|
3
|
-
[
|
|
4
|
-
"mkdirp-classic@0.5.3",
|
|
5
|
-
"/home/runner/work/node-datachannel/node-datachannel"
|
|
6
|
-
]
|
|
7
|
-
],
|
|
8
|
-
"_from": "mkdirp-classic@0.5.3",
|
|
9
|
-
"_id": "mkdirp-classic@0.5.3",
|
|
10
|
-
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
|
|
12
|
-
"_location": "/mkdirp-classic",
|
|
13
|
-
"_phantomChildren": {},
|
|
14
|
-
"_requested": {
|
|
15
|
-
"type": "version",
|
|
16
|
-
"registry": true,
|
|
17
|
-
"raw": "mkdirp-classic@0.5.3",
|
|
18
|
-
"name": "mkdirp-classic",
|
|
19
|
-
"escapedName": "mkdirp-classic",
|
|
20
|
-
"rawSpec": "0.5.3",
|
|
21
|
-
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "0.5.3"
|
|
23
|
-
},
|
|
24
|
-
"_requiredBy": [
|
|
25
|
-
"/prebuild-install",
|
|
26
|
-
"/tar-fs"
|
|
27
|
-
],
|
|
28
|
-
"_resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
|
29
|
-
"_spec": "0.5.3",
|
|
30
|
-
"_where": "/home/runner/work/node-datachannel/node-datachannel",
|
|
31
|
-
"author": {
|
|
32
|
-
"name": "Mathias Buus",
|
|
33
|
-
"url": "@mafintosh"
|
|
34
|
-
},
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/mafintosh/mkdirp-classic/issues"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {},
|
|
39
|
-
"description": "Mirror of mkdirp 0.5.2",
|
|
40
|
-
"devDependencies": {},
|
|
41
|
-
"homepage": "https://github.com/mafintosh/mkdirp-classic",
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"main": "index.js",
|
|
44
|
-
"name": "mkdirp-classic",
|
|
45
|
-
"repository": {
|
|
46
|
-
"type": "git",
|
|
47
|
-
"url": "git+https://github.com/mafintosh/mkdirp-classic.git"
|
|
48
|
-
},
|
|
49
|
-
"version": "0.5.3"
|
|
50
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 inspiredware
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# napi-build-utils
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/napi-build-utils)
|
|
4
|
-

|
|
5
|
-
[](https://travis-ci.org/inspiredware/napi-build-utils)
|
|
6
|
-
[](http://standardjs.com/)
|
|
7
|
-
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
|
|
9
|
-
A set of utilities to assist developers of tools that build [N-API](https://nodejs.org/api/n-api.html#n_api_n_api) native add-ons.
|
|
10
|
-
|
|
11
|
-
## Background
|
|
12
|
-
|
|
13
|
-
This module is targeted to developers creating tools that build N-API native add-ons.
|
|
14
|
-
|
|
15
|
-
It implements a set of functions that aid in determining the N-API version supported by the currently running Node instance and the set of N-API versions against which the N-API native add-on is designed to be built. Other functions determine whether a particular N-API version can be built and can issue console warnings for unsupported N-API versions.
|
|
16
|
-
|
|
17
|
-
Unlike the modules this code is designed to facilitate building, this module is written entirely in JavaScript.
|
|
18
|
-
|
|
19
|
-
## Quick start
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
$ npm install napi-build-utils
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The module exports a set of functions documented [here](./index.md). For example:
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
var napiBuildUtils = require('napi-build-utils');
|
|
29
|
-
var napiVersion = napiBuildUtils.getNapiVersion(); // N-API version supported by Node, or undefined.
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Declaring supported N-API versions
|
|
33
|
-
|
|
34
|
-
Native modules that are designed to work with [N-API](https://nodejs.org/api/n-api.html#n_api_n_api) must explicitly declare the N-API version(s) against which they are coded to build. This is accomplished by including a `binary.napi_versions` property in the module's `package.json` file. For example:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
"binary": {
|
|
38
|
-
"napi_versions": [2,3]
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
In the absence of a need to compile against a specific N-API version, the value `3` is a good choice as this is the N-API version that was supported when N-API left experimental status.
|
|
43
|
-
|
|
44
|
-
Modules that are built against a specific N-API version will continue to operate indefinitely, even as later versions of N-API are introduced.
|
|
45
|
-
|
|
46
|
-
## Support
|
|
47
|
-
|
|
48
|
-
If you run into problems or limitations, please file an issue and we'll take a look. Pull requests are also welcome.
|