cline 1.0.0-nightly.4 → 1.0.0-nightly.6
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/bin/cline +0 -0
- package/bin/cline-host +0 -0
- package/cline-1.0.0-nightly.5.tgz +0 -0
- package/extension/package.json +512 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/better-sqlite3/LICENSE +21 -0
- package/node_modules/better-sqlite3/README.md +99 -0
- package/node_modules/better-sqlite3/binding.gyp +38 -0
- package/node_modules/better-sqlite3/deps/common.gypi +68 -0
- package/node_modules/better-sqlite3/deps/copy.js +31 -0
- package/node_modules/better-sqlite3/deps/defines.gypi +41 -0
- package/node_modules/better-sqlite3/deps/download.sh +122 -0
- package/node_modules/better-sqlite3/deps/patches/1208.patch +15 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +262875 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +13775 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h +723 -0
- package/node_modules/better-sqlite3/deps/sqlite3.gyp +80 -0
- package/node_modules/better-sqlite3/deps/test_extension.c +21 -0
- package/node_modules/better-sqlite3/lib/database.js +90 -0
- package/node_modules/better-sqlite3/lib/index.js +3 -0
- package/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/node_modules/better-sqlite3/lib/util.js +12 -0
- package/node_modules/better-sqlite3/package.json +62 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.cpp +2189 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.hpp +1036 -0
- package/node_modules/bindings/LICENSE.md +22 -0
- package/node_modules/bindings/README.md +98 -0
- package/node_modules/bindings/bindings.js +221 -0
- package/node_modules/bindings/package.json +28 -0
- package/node_modules/bl/.travis.yml +17 -0
- package/node_modules/bl/BufferList.js +396 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/package.json +37 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +869 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +96 -0
- package/node_modules/chownr/LICENSE +15 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/chownr.js +167 -0
- package/node_modules/chownr/package.json +29 -0
- package/node_modules/decompress-response/index.d.ts +22 -0
- package/node_modules/decompress-response/index.js +58 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/package.json +56 -0
- package/node_modules/decompress-response/readme.md +48 -0
- package/node_modules/deep-extend/LICENSE +20 -0
- package/node_modules/deep-extend/README.md +91 -0
- package/node_modules/deep-extend/index.js +1 -0
- package/node_modules/deep-extend/lib/deep-extend.js +150 -0
- package/node_modules/deep-extend/package.json +62 -0
- package/node_modules/detect-libc/LICENSE +201 -0
- package/node_modules/detect-libc/README.md +163 -0
- package/node_modules/detect-libc/index.d.ts +14 -0
- package/node_modules/detect-libc/lib/detect-libc.js +267 -0
- package/node_modules/detect-libc/lib/filesystem.js +41 -0
- package/node_modules/detect-libc/lib/process.js +24 -0
- package/node_modules/detect-libc/package.json +41 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +96 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/expand-template/.travis.yml +6 -0
- package/node_modules/expand-template/LICENSE +21 -0
- package/node_modules/expand-template/README.md +43 -0
- package/node_modules/expand-template/index.js +26 -0
- package/node_modules/expand-template/package.json +29 -0
- package/node_modules/expand-template/test.js +67 -0
- package/node_modules/file-uri-to-path/.npmignore +1 -0
- package/node_modules/file-uri-to-path/.travis.yml +30 -0
- package/node_modules/file-uri-to-path/History.md +21 -0
- package/node_modules/file-uri-to-path/LICENSE +20 -0
- package/node_modules/file-uri-to-path/README.md +74 -0
- package/node_modules/file-uri-to-path/index.d.ts +2 -0
- package/node_modules/file-uri-to-path/index.js +66 -0
- package/node_modules/file-uri-to-path/package.json +32 -0
- package/node_modules/file-uri-to-path/test/test.js +24 -0
- package/node_modules/file-uri-to-path/test/tests.json +13 -0
- package/node_modules/fs-constants/LICENSE +21 -0
- package/node_modules/fs-constants/README.md +26 -0
- package/node_modules/fs-constants/browser.js +1 -0
- package/node_modules/fs-constants/index.js +1 -0
- package/node_modules/fs-constants/package.json +19 -0
- package/node_modules/github-from-package/.travis.yml +4 -0
- package/node_modules/github-from-package/LICENSE +18 -0
- package/node_modules/github-from-package/example/package.json +8 -0
- package/node_modules/github-from-package/example/url.js +3 -0
- package/node_modules/github-from-package/index.js +17 -0
- package/node_modules/github-from-package/package.json +30 -0
- package/node_modules/github-from-package/readme.markdown +53 -0
- package/node_modules/github-from-package/test/a.json +8 -0
- package/node_modules/github-from-package/test/b.json +5 -0
- package/node_modules/github-from-package/test/c.json +5 -0
- package/node_modules/github-from-package/test/d.json +7 -0
- package/node_modules/github-from-package/test/e.json +5 -0
- package/node_modules/github-from-package/test/url.js +19 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ini/LICENSE +15 -0
- package/node_modules/ini/README.md +102 -0
- package/node_modules/ini/ini.js +206 -0
- package/node_modules/ini/package.json +33 -0
- package/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/mimic-response/index.js +77 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +42 -0
- package/node_modules/mimic-response/readme.md +78 -0
- package/node_modules/minimist/.eslintrc +29 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +298 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/README.md +121 -0
- package/node_modules/minimist/example/parse.js +4 -0
- package/node_modules/minimist/index.js +263 -0
- package/node_modules/minimist/package.json +75 -0
- package/node_modules/minimist/test/all_bool.js +34 -0
- package/node_modules/minimist/test/bool.js +177 -0
- package/node_modules/minimist/test/dash.js +43 -0
- package/node_modules/minimist/test/default_bool.js +37 -0
- package/node_modules/minimist/test/dotted.js +24 -0
- package/node_modules/minimist/test/kv_short.js +32 -0
- package/node_modules/minimist/test/long.js +33 -0
- package/node_modules/minimist/test/num.js +38 -0
- package/node_modules/minimist/test/parse.js +209 -0
- package/node_modules/minimist/test/parse_modified.js +11 -0
- package/node_modules/minimist/test/proto.js +64 -0
- package/node_modules/minimist/test/short.js +69 -0
- package/node_modules/minimist/test/stop_early.js +17 -0
- package/node_modules/minimist/test/unknown.js +104 -0
- package/node_modules/minimist/test/whitespace.js +10 -0
- package/node_modules/mkdirp-classic/LICENSE +21 -0
- package/node_modules/mkdirp-classic/README.md +18 -0
- package/node_modules/mkdirp-classic/index.js +98 -0
- package/node_modules/mkdirp-classic/package.json +18 -0
- package/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +31 -0
- package/node_modules/napi-build-utils/LICENSE +21 -0
- package/node_modules/napi-build-utils/README.md +52 -0
- package/node_modules/napi-build-utils/index.js +214 -0
- package/node_modules/napi-build-utils/index.md +0 -0
- package/node_modules/napi-build-utils/package.json +42 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +54 -0
- package/node_modules/node-abi/abi_registry.json +408 -0
- package/node_modules/node-abi/index.js +179 -0
- package/node_modules/node-abi/package.json +45 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/prebuild-install/CHANGELOG.md +131 -0
- package/node_modules/prebuild-install/CONTRIBUTING.md +6 -0
- package/node_modules/prebuild-install/LICENSE +21 -0
- package/node_modules/prebuild-install/README.md +163 -0
- package/node_modules/prebuild-install/asset.js +44 -0
- package/node_modules/prebuild-install/bin.js +78 -0
- package/node_modules/prebuild-install/download.js +142 -0
- package/node_modules/prebuild-install/error.js +14 -0
- package/node_modules/prebuild-install/help.txt +16 -0
- package/node_modules/prebuild-install/index.js +1 -0
- package/node_modules/prebuild-install/log.js +33 -0
- package/node_modules/prebuild-install/package.json +67 -0
- package/node_modules/prebuild-install/proxy.js +35 -0
- package/node_modules/prebuild-install/rc.js +64 -0
- package/node_modules/prebuild-install/util.js +143 -0
- package/node_modules/pump/.github/FUNDING.yml +2 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +74 -0
- package/node_modules/pump/SECURITY.md +5 -0
- package/node_modules/pump/index.js +86 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/rc/LICENSE.APACHE2 +15 -0
- package/node_modules/rc/LICENSE.BSD +26 -0
- package/node_modules/rc/LICENSE.MIT +24 -0
- package/node_modules/rc/README.md +227 -0
- package/node_modules/rc/browser.js +7 -0
- package/node_modules/rc/cli.js +4 -0
- package/node_modules/rc/index.js +53 -0
- package/node_modules/rc/lib/utils.js +104 -0
- package/node_modules/rc/package.json +29 -0
- package/node_modules/rc/test/ini.js +16 -0
- package/node_modules/rc/test/nested-env-vars.js +50 -0
- package/node_modules/rc/test/test.js +59 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +68 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +664 -0
- package/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +556 -0
- package/node_modules/semver/classes/semver.js +319 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +91 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +25 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/simple-concat/.travis.yml +3 -0
- package/node_modules/simple-concat/LICENSE +20 -0
- package/node_modules/simple-concat/README.md +44 -0
- package/node_modules/simple-concat/index.js +15 -0
- package/node_modules/simple-concat/package.json +47 -0
- package/node_modules/simple-concat/test/basic.js +41 -0
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/LICENSE +20 -0
- package/node_modules/simple-get/README.md +333 -0
- package/node_modules/simple-get/index.js +108 -0
- package/node_modules/simple-get/package.json +67 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +34 -0
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/license +21 -0
- package/node_modules/strip-json-comments/package.json +42 -0
- package/node_modules/strip-json-comments/readme.md +64 -0
- package/node_modules/tar-fs/.travis.yml +6 -0
- package/node_modules/tar-fs/LICENSE +21 -0
- package/node_modules/tar-fs/README.md +165 -0
- package/node_modules/tar-fs/index.js +358 -0
- package/node_modules/tar-fs/package.json +41 -0
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
- 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 +346 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +168 -0
- package/node_modules/tar-stream/extract.js +257 -0
- package/node_modules/tar-stream/headers.js +295 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/pack.js +255 -0
- package/node_modules/tar-stream/package.json +58 -0
- package/node_modules/tar-stream/sandbox.js +11 -0
- package/node_modules/tunnel-agent/LICENSE +55 -0
- package/node_modules/tunnel-agent/README.md +4 -0
- package/node_modules/tunnel-agent/index.js +244 -0
- package/node_modules/tunnel-agent/package.json +22 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +2 -6
- package/postinstall.js +0 -117
- /package/{vscode → fake_node_modules/vscode}/enhanced-terminal.js +0 -0
- /package/{vscode → fake_node_modules/vscode}/index.js +0 -0
- /package/{vscode → fake_node_modules/vscode}/package.json +0 -0
- /package/{vscode → fake_node_modules/vscode}/stub-utils.js +0 -0
- /package/{vscode → fake_node_modules/vscode}/vscode-impls.js +0 -0
- /package/{vscode → fake_node_modules/vscode}/vscode-stubs.js +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const get = require('simple-get')
|
|
4
|
+
const pump = require('pump')
|
|
5
|
+
const tfs = require('tar-fs')
|
|
6
|
+
const zlib = require('zlib')
|
|
7
|
+
const util = require('./util')
|
|
8
|
+
const error = require('./error')
|
|
9
|
+
const proxy = require('./proxy')
|
|
10
|
+
const mkdirp = require('mkdirp-classic')
|
|
11
|
+
|
|
12
|
+
function downloadPrebuild (downloadUrl, opts, cb) {
|
|
13
|
+
let cachedPrebuild = util.cachedPrebuild(downloadUrl)
|
|
14
|
+
const localPrebuild = util.localPrebuild(downloadUrl, opts)
|
|
15
|
+
const tempFile = util.tempFile(cachedPrebuild)
|
|
16
|
+
const log = opts.log || util.noopLogger
|
|
17
|
+
|
|
18
|
+
if (opts.nolocal) return download()
|
|
19
|
+
|
|
20
|
+
log.info('looking for local prebuild @', localPrebuild)
|
|
21
|
+
fs.access(localPrebuild, fs.R_OK | fs.W_OK, function (err) {
|
|
22
|
+
if (err && err.code === 'ENOENT') {
|
|
23
|
+
return download()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
log.info('found local prebuild')
|
|
27
|
+
cachedPrebuild = localPrebuild
|
|
28
|
+
unpack()
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
function download () {
|
|
32
|
+
ensureNpmCacheDir(function (err) {
|
|
33
|
+
if (err) return onerror(err)
|
|
34
|
+
|
|
35
|
+
log.info('looking for cached prebuild @', cachedPrebuild)
|
|
36
|
+
fs.access(cachedPrebuild, fs.R_OK | fs.W_OK, function (err) {
|
|
37
|
+
if (!(err && err.code === 'ENOENT')) {
|
|
38
|
+
log.info('found cached prebuild')
|
|
39
|
+
return unpack()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
log.http('request', 'GET ' + downloadUrl)
|
|
43
|
+
const reqOpts = proxy({ url: downloadUrl }, opts)
|
|
44
|
+
|
|
45
|
+
if (opts.token) {
|
|
46
|
+
reqOpts.headers = {
|
|
47
|
+
'User-Agent': 'simple-get',
|
|
48
|
+
Accept: 'application/octet-stream',
|
|
49
|
+
Authorization: 'token ' + opts.token
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const req = get(reqOpts, function (err, res) {
|
|
54
|
+
if (err) return onerror(err)
|
|
55
|
+
log.http(res.statusCode, downloadUrl)
|
|
56
|
+
if (res.statusCode !== 200) return onerror()
|
|
57
|
+
mkdirp(util.prebuildCache(), function () {
|
|
58
|
+
log.info('downloading to @', tempFile)
|
|
59
|
+
pump(res, fs.createWriteStream(tempFile), function (err) {
|
|
60
|
+
if (err) return onerror(err)
|
|
61
|
+
fs.rename(tempFile, cachedPrebuild, function (err) {
|
|
62
|
+
if (err) return cb(err)
|
|
63
|
+
log.info('renaming to @', cachedPrebuild)
|
|
64
|
+
unpack()
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
req.setTimeout(30 * 1000, function () {
|
|
71
|
+
req.abort()
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
function onerror (err) {
|
|
76
|
+
fs.unlink(tempFile, function () {
|
|
77
|
+
cb(err || error.noPrebuilts(opts))
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function unpack () {
|
|
84
|
+
let binaryName
|
|
85
|
+
|
|
86
|
+
const updateName = opts.updateName || function (entry) {
|
|
87
|
+
if (/\.node$/i.test(entry.name)) binaryName = entry.name
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
log.info('unpacking @', cachedPrebuild)
|
|
91
|
+
|
|
92
|
+
const options = {
|
|
93
|
+
readable: true,
|
|
94
|
+
writable: true,
|
|
95
|
+
hardlinkAsFilesFallback: true
|
|
96
|
+
}
|
|
97
|
+
const extract = tfs.extract(opts.path, options).on('entry', updateName)
|
|
98
|
+
|
|
99
|
+
pump(fs.createReadStream(cachedPrebuild), zlib.createGunzip(), extract,
|
|
100
|
+
function (err) {
|
|
101
|
+
if (err) return cb(err)
|
|
102
|
+
|
|
103
|
+
let resolved
|
|
104
|
+
if (binaryName) {
|
|
105
|
+
try {
|
|
106
|
+
resolved = path.resolve(opts.path || '.', binaryName)
|
|
107
|
+
} catch (err) {
|
|
108
|
+
return cb(err)
|
|
109
|
+
}
|
|
110
|
+
log.info('unpack', 'resolved to ' + resolved)
|
|
111
|
+
|
|
112
|
+
if (opts.runtime === 'node' && opts.platform === process.platform && opts.abi === process.versions.modules && opts.arch === process.arch) {
|
|
113
|
+
try {
|
|
114
|
+
require(resolved)
|
|
115
|
+
} catch (err) {
|
|
116
|
+
return cb(err)
|
|
117
|
+
}
|
|
118
|
+
log.info('unpack', 'required ' + resolved + ' successfully')
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
cb(null, resolved)
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function ensureNpmCacheDir (cb) {
|
|
127
|
+
const cacheFolder = util.npmCache()
|
|
128
|
+
fs.access(cacheFolder, fs.R_OK | fs.W_OK, function (err) {
|
|
129
|
+
if (err && err.code === 'ENOENT') {
|
|
130
|
+
return makeNpmCacheDir()
|
|
131
|
+
}
|
|
132
|
+
cb(err)
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
function makeNpmCacheDir () {
|
|
136
|
+
log.info('npm cache directory missing, creating it...')
|
|
137
|
+
mkdirp(cacheFolder, cb)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
module.exports = downloadPrebuild
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
exports.noPrebuilts = function (opts) {
|
|
2
|
+
return new Error([
|
|
3
|
+
'No prebuilt binaries found',
|
|
4
|
+
'(target=' + opts.target,
|
|
5
|
+
'runtime=' + opts.runtime,
|
|
6
|
+
'arch=' + opts.arch,
|
|
7
|
+
'libc=' + opts.libc,
|
|
8
|
+
'platform=' + opts.platform + ')'
|
|
9
|
+
].join(' '))
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.invalidArchive = function () {
|
|
13
|
+
return new Error('Missing .node file in archive')
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
prebuild-install [options]
|
|
2
|
+
|
|
3
|
+
--download -d [url] (download prebuilds, no url means github)
|
|
4
|
+
--target -t version (version to install for)
|
|
5
|
+
--runtime -r runtime (Node runtime [node or electron] to build or install for, default is node)
|
|
6
|
+
--path -p path (make a prebuild-install here)
|
|
7
|
+
--token -T gh-token (github token for private repos)
|
|
8
|
+
--arch arch (target CPU architecture, see Node OS module docs, default is current arch)
|
|
9
|
+
--platform platform (target platform, see Node OS module docs, default is current platform)
|
|
10
|
+
--tag-prefix <prefix> (github tag prefix, default is "v")
|
|
11
|
+
--force (always use prebuilt binaries when available)
|
|
12
|
+
--build-from-source (skip prebuild download)
|
|
13
|
+
--verbose (log verbosely)
|
|
14
|
+
--libc (use provided libc rather than system default)
|
|
15
|
+
--debug (set Debug or Release configuration)
|
|
16
|
+
--version (print prebuild-install version and exit)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.download = require('./download')
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const levels = {
|
|
2
|
+
silent: 0,
|
|
3
|
+
error: 1,
|
|
4
|
+
warn: 2,
|
|
5
|
+
notice: 3,
|
|
6
|
+
http: 4,
|
|
7
|
+
timing: 5,
|
|
8
|
+
info: 6,
|
|
9
|
+
verbose: 7,
|
|
10
|
+
silly: 8
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = function (rc, env) {
|
|
14
|
+
const level = rc.verbose
|
|
15
|
+
? 'verbose'
|
|
16
|
+
: env.npm_config_loglevel || 'notice'
|
|
17
|
+
|
|
18
|
+
const logAtLevel = function (messageLevel) {
|
|
19
|
+
return function (...args) {
|
|
20
|
+
if (levels[messageLevel] <= levels[level]) {
|
|
21
|
+
console.error(`prebuild-install ${messageLevel} ${args.join(' ')}`)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
error: logAtLevel('error'),
|
|
28
|
+
warn: logAtLevel('warn'),
|
|
29
|
+
http: logAtLevel('http'),
|
|
30
|
+
info: logAtLevel('info'),
|
|
31
|
+
level
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "prebuild-install",
|
|
3
|
+
"version": "7.1.3",
|
|
4
|
+
"description": "A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "standard && hallmark && tape test/*-test.js",
|
|
7
|
+
"hallmark": "hallmark --fix"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"prebuilt",
|
|
11
|
+
"binaries",
|
|
12
|
+
"native",
|
|
13
|
+
"addon",
|
|
14
|
+
"module",
|
|
15
|
+
"c",
|
|
16
|
+
"c++",
|
|
17
|
+
"bindings",
|
|
18
|
+
"devops",
|
|
19
|
+
"napi"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"detect-libc": "^2.0.0",
|
|
23
|
+
"expand-template": "^2.0.3",
|
|
24
|
+
"github-from-package": "0.0.0",
|
|
25
|
+
"minimist": "^1.2.3",
|
|
26
|
+
"mkdirp-classic": "^0.5.3",
|
|
27
|
+
"napi-build-utils": "^2.0.0",
|
|
28
|
+
"node-abi": "^3.3.0",
|
|
29
|
+
"pump": "^3.0.0",
|
|
30
|
+
"rc": "^1.2.7",
|
|
31
|
+
"simple-get": "^4.0.0",
|
|
32
|
+
"tar-fs": "^2.0.0",
|
|
33
|
+
"tunnel-agent": "^0.6.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"a-native-module": "^1.0.0",
|
|
37
|
+
"hallmark": "^4.0.0",
|
|
38
|
+
"nock": "^10.0.6",
|
|
39
|
+
"rimraf": "^2.5.2",
|
|
40
|
+
"standard": "^16.0.4",
|
|
41
|
+
"tape": "^5.3.1",
|
|
42
|
+
"tempy": "0.2.1"
|
|
43
|
+
},
|
|
44
|
+
"bin": "./bin.js",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/prebuild/prebuild-install.git"
|
|
48
|
+
},
|
|
49
|
+
"author": "Mathias Buus (@mafintosh)",
|
|
50
|
+
"contributors": [
|
|
51
|
+
"Julian Gruber <julian@juliangruber.com> (https://github.com/juliangruber)",
|
|
52
|
+
"Brett Lawson <brett19@gmail.com> (https://github.com/brett19)",
|
|
53
|
+
"Pieter Hintjens <ph@imatix.com> (https://github.com/hintjens)",
|
|
54
|
+
"Lars-Magnus Skog <ralphtheninja@riseup.net> (https://github.com/ralphtheninja)",
|
|
55
|
+
"Jesús Leganés Combarro <piranna@gmail.com> (https://github.com/piranna)",
|
|
56
|
+
"Mathias Küsel <mathiask@hotmail.de> (https://github.com/mathiask88)",
|
|
57
|
+
"Lukas Geiger <lukas.geiger94@gmail.com> (https://github.com/lgeiger)"
|
|
58
|
+
],
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"bugs": {
|
|
61
|
+
"url": "https://github.com/prebuild/prebuild-install/issues"
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://github.com/prebuild/prebuild-install",
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=10"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const url = require('url')
|
|
2
|
+
const tunnel = require('tunnel-agent')
|
|
3
|
+
const util = require('./util')
|
|
4
|
+
|
|
5
|
+
function applyProxy (reqOpts, opts) {
|
|
6
|
+
const log = opts.log || util.noopLogger
|
|
7
|
+
|
|
8
|
+
const proxy = opts['https-proxy'] || opts.proxy
|
|
9
|
+
|
|
10
|
+
if (proxy) {
|
|
11
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
12
|
+
const parsedDownloadUrl = url.parse(reqOpts.url)
|
|
13
|
+
// eslint-disable-next-line node/no-deprecated-api
|
|
14
|
+
const parsedProxy = url.parse(proxy)
|
|
15
|
+
const uriProtocol = (parsedDownloadUrl.protocol === 'https:' ? 'https' : 'http')
|
|
16
|
+
const proxyProtocol = (parsedProxy.protocol === 'https:' ? 'Https' : 'Http')
|
|
17
|
+
const tunnelFnName = [uriProtocol, proxyProtocol].join('Over')
|
|
18
|
+
reqOpts.agent = tunnel[tunnelFnName]({
|
|
19
|
+
proxy: {
|
|
20
|
+
host: parsedProxy.hostname,
|
|
21
|
+
port: +parsedProxy.port,
|
|
22
|
+
proxyAuth: parsedProxy.auth
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
log.http('request', 'Proxy setup detected (Host: ' +
|
|
26
|
+
parsedProxy.hostname + ', Port: ' +
|
|
27
|
+
parsedProxy.port + ', Authentication: ' +
|
|
28
|
+
(parsedProxy.auth ? 'Yes' : 'No') + ')' +
|
|
29
|
+
' Tunneling with ' + tunnelFnName)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return reqOpts
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = applyProxy
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const minimist = require('minimist')
|
|
3
|
+
const getAbi = require('node-abi').getAbi
|
|
4
|
+
const detectLibc = require('detect-libc')
|
|
5
|
+
const napi = require('napi-build-utils')
|
|
6
|
+
|
|
7
|
+
const env = process.env
|
|
8
|
+
|
|
9
|
+
const libc = env.LIBC || process.env.npm_config_libc ||
|
|
10
|
+
(detectLibc.isNonGlibcLinuxSync() && detectLibc.familySync()) || ''
|
|
11
|
+
|
|
12
|
+
// Get the configuration
|
|
13
|
+
module.exports = function (pkg) {
|
|
14
|
+
const pkgConf = pkg.config || {}
|
|
15
|
+
const buildFromSource = env.npm_config_build_from_source
|
|
16
|
+
|
|
17
|
+
const rc = require('rc')('prebuild-install', {
|
|
18
|
+
target: pkgConf.target || env.npm_config_target || process.versions.node,
|
|
19
|
+
runtime: pkgConf.runtime || env.npm_config_runtime || 'node',
|
|
20
|
+
arch: pkgConf.arch || env.npm_config_arch || process.arch,
|
|
21
|
+
libc: libc,
|
|
22
|
+
platform: env.npm_config_platform || process.platform,
|
|
23
|
+
debug: env.npm_config_debug === 'true',
|
|
24
|
+
force: false,
|
|
25
|
+
verbose: env.npm_config_verbose === 'true',
|
|
26
|
+
buildFromSource: buildFromSource === pkg.name || buildFromSource === 'true',
|
|
27
|
+
path: '.',
|
|
28
|
+
proxy: env.npm_config_proxy || env.http_proxy || env.HTTP_PROXY,
|
|
29
|
+
'https-proxy': env.npm_config_https_proxy || env.https_proxy || env.HTTPS_PROXY,
|
|
30
|
+
'local-address': env.npm_config_local_address,
|
|
31
|
+
'local-prebuilds': 'prebuilds',
|
|
32
|
+
'tag-prefix': 'v',
|
|
33
|
+
download: env.npm_config_download
|
|
34
|
+
}, minimist(process.argv, {
|
|
35
|
+
alias: {
|
|
36
|
+
target: 't',
|
|
37
|
+
runtime: 'r',
|
|
38
|
+
help: 'h',
|
|
39
|
+
arch: 'a',
|
|
40
|
+
path: 'p',
|
|
41
|
+
version: 'v',
|
|
42
|
+
download: 'd',
|
|
43
|
+
buildFromSource: 'build-from-source',
|
|
44
|
+
token: 'T'
|
|
45
|
+
}
|
|
46
|
+
}))
|
|
47
|
+
|
|
48
|
+
rc.path = path.resolve(rc.path === true ? '.' : rc.path || '.')
|
|
49
|
+
|
|
50
|
+
if (napi.isNapiRuntime(rc.runtime) && rc.target === process.versions.node) {
|
|
51
|
+
rc.target = napi.getBestNapiBuildVersion()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
rc.abi = napi.isNapiRuntime(rc.runtime) ? rc.target : getAbi(rc.target, rc.runtime)
|
|
55
|
+
|
|
56
|
+
rc.libc = rc.platform !== 'linux' || rc.libc === detectLibc.GLIBC ? '' : rc.libc
|
|
57
|
+
|
|
58
|
+
return rc
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Print the configuration values when executed standalone for testing purposses
|
|
62
|
+
if (!module.parent) {
|
|
63
|
+
console.log(JSON.stringify(module.exports({}), null, 2))
|
|
64
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const github = require('github-from-package')
|
|
3
|
+
const home = require('os').homedir
|
|
4
|
+
const crypto = require('crypto')
|
|
5
|
+
const expandTemplate = require('expand-template')()
|
|
6
|
+
|
|
7
|
+
function getDownloadUrl (opts) {
|
|
8
|
+
const pkgName = opts.pkg.name.replace(/^@[a-zA-Z0-9_\-.~]+\//, '')
|
|
9
|
+
return expandTemplate(urlTemplate(opts), {
|
|
10
|
+
name: pkgName,
|
|
11
|
+
package_name: pkgName,
|
|
12
|
+
version: opts.pkg.version,
|
|
13
|
+
major: opts.pkg.version.split('.')[0],
|
|
14
|
+
minor: opts.pkg.version.split('.')[1],
|
|
15
|
+
patch: opts.pkg.version.split('.')[2],
|
|
16
|
+
prerelease: opts.pkg.version.split('-')[1],
|
|
17
|
+
build: opts.pkg.version.split('+')[1],
|
|
18
|
+
abi: opts.abi || process.versions.modules,
|
|
19
|
+
node_abi: process.versions.modules,
|
|
20
|
+
runtime: opts.runtime || 'node',
|
|
21
|
+
platform: opts.platform,
|
|
22
|
+
arch: opts.arch,
|
|
23
|
+
libc: opts.libc || '',
|
|
24
|
+
configuration: (opts.debug ? 'Debug' : 'Release'),
|
|
25
|
+
module_name: opts.pkg.binary && opts.pkg.binary.module_name,
|
|
26
|
+
tag_prefix: opts['tag-prefix']
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getApiUrl (opts) {
|
|
31
|
+
return github(opts.pkg).replace('github.com', 'api.github.com/repos') + '/releases'
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getAssetUrl (opts, assetId) {
|
|
35
|
+
return getApiUrl(opts) + '/assets/' + assetId
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function urlTemplate (opts) {
|
|
39
|
+
if (typeof opts.download === 'string') {
|
|
40
|
+
return opts.download
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const packageName = '{name}-v{version}-{runtime}-v{abi}-{platform}{libc}-{arch}.tar.gz'
|
|
44
|
+
const hostMirrorUrl = getHostMirrorUrl(opts)
|
|
45
|
+
|
|
46
|
+
if (hostMirrorUrl) {
|
|
47
|
+
return hostMirrorUrl + '/{tag_prefix}{version}/' + packageName
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (opts.pkg.binary && opts.pkg.binary.host) {
|
|
51
|
+
return [
|
|
52
|
+
opts.pkg.binary.host,
|
|
53
|
+
opts.pkg.binary.remote_path,
|
|
54
|
+
opts.pkg.binary.package_name || packageName
|
|
55
|
+
].map(function (path) {
|
|
56
|
+
return trimSlashes(path)
|
|
57
|
+
}).filter(Boolean).join('/')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return github(opts.pkg) + '/releases/download/{tag_prefix}{version}/' + packageName
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getEnvPrefix (pkgName) {
|
|
64
|
+
return 'npm_config_' + (pkgName || '').replace(/[^a-zA-Z0-9]/g, '_').replace(/^_/, '')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getHostMirrorUrl (opts) {
|
|
68
|
+
const propName = getEnvPrefix(opts.pkg.name) + '_binary_host'
|
|
69
|
+
return process.env[propName] || process.env[propName + '_mirror']
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function trimSlashes (str) {
|
|
73
|
+
if (str) return str.replace(/^\.\/|^\/|\/$/g, '')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function cachedPrebuild (url) {
|
|
77
|
+
const digest = crypto.createHash('sha512').update(url).digest('hex').slice(0, 6)
|
|
78
|
+
return path.join(prebuildCache(), digest + '-' + path.basename(url).replace(/[^a-zA-Z0-9.]+/g, '-'))
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function npmCache () {
|
|
82
|
+
const env = process.env
|
|
83
|
+
return env.npm_config_cache || (env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(home(), '.npm'))
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function prebuildCache () {
|
|
87
|
+
return path.join(npmCache(), '_prebuilds')
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function tempFile (cached) {
|
|
91
|
+
return cached + '.' + process.pid + '-' + Math.random().toString(16).slice(2) + '.tmp'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function packageOrigin (env, pkg) {
|
|
95
|
+
// npm <= 6: metadata is stored on disk in node_modules
|
|
96
|
+
if (pkg._from) {
|
|
97
|
+
return pkg._from
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// npm 7: metadata is exposed to environment by arborist
|
|
101
|
+
if (env.npm_package_from) {
|
|
102
|
+
// NOTE: seems undefined atm (npm 7.0.2)
|
|
103
|
+
return env.npm_package_from
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (env.npm_package_resolved) {
|
|
107
|
+
// NOTE: not sure about the difference with _from, but it's all we have
|
|
108
|
+
return env.npm_package_resolved
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function localPrebuild (url, opts) {
|
|
113
|
+
const propName = getEnvPrefix(opts.pkg.name) + '_local_prebuilds'
|
|
114
|
+
const prefix = process.env[propName] || opts['local-prebuilds'] || 'prebuilds'
|
|
115
|
+
return path.join(prefix, path.basename(url))
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const noopLogger = {
|
|
119
|
+
http: function () {},
|
|
120
|
+
silly: function () {},
|
|
121
|
+
debug: function () {},
|
|
122
|
+
info: function () {},
|
|
123
|
+
warn: function () {},
|
|
124
|
+
error: function () {},
|
|
125
|
+
critical: function () {},
|
|
126
|
+
alert: function () {},
|
|
127
|
+
emergency: function () {},
|
|
128
|
+
notice: function () {},
|
|
129
|
+
verbose: function () {},
|
|
130
|
+
fatal: function () {}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
exports.getDownloadUrl = getDownloadUrl
|
|
134
|
+
exports.getApiUrl = getApiUrl
|
|
135
|
+
exports.getAssetUrl = getAssetUrl
|
|
136
|
+
exports.urlTemplate = urlTemplate
|
|
137
|
+
exports.cachedPrebuild = cachedPrebuild
|
|
138
|
+
exports.localPrebuild = localPrebuild
|
|
139
|
+
exports.prebuildCache = prebuildCache
|
|
140
|
+
exports.npmCache = npmCache
|
|
141
|
+
exports.tempFile = tempFile
|
|
142
|
+
exports.packageOrigin = packageOrigin
|
|
143
|
+
exports.noopLogger = noopLogger
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 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.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# pump
|
|
2
|
+
|
|
3
|
+
pump is a small node module that pipes streams together and destroys all of them if one of them closes.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install pump
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
[](http://travis-ci.org/mafintosh/pump)
|
|
10
|
+
|
|
11
|
+
## What problem does it solve?
|
|
12
|
+
|
|
13
|
+
When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error.
|
|
14
|
+
You are also not able to provide a callback to tell when then pipe has finished.
|
|
15
|
+
|
|
16
|
+
pump does these two things for you
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Simply pass the streams you want to pipe together to pump and add an optional callback
|
|
21
|
+
|
|
22
|
+
``` js
|
|
23
|
+
var pump = require('pump')
|
|
24
|
+
var fs = require('fs')
|
|
25
|
+
|
|
26
|
+
var source = fs.createReadStream('/dev/random')
|
|
27
|
+
var dest = fs.createWriteStream('/dev/null')
|
|
28
|
+
|
|
29
|
+
pump(source, dest, function(err) {
|
|
30
|
+
console.log('pipe finished', err)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
setTimeout(function() {
|
|
34
|
+
dest.destroy() // when dest is closed pump will destroy source
|
|
35
|
+
}, 1000)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
You can use pump to pipe more than two streams together as well
|
|
39
|
+
|
|
40
|
+
``` js
|
|
41
|
+
var transform = someTransformStream()
|
|
42
|
+
|
|
43
|
+
pump(source, transform, anotherTransform, dest, function(err) {
|
|
44
|
+
console.log('pipe finished', err)
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed.
|
|
49
|
+
|
|
50
|
+
Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
return pump(s1, s2) // returns s2
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Note that `pump` attaches error handlers to the streams to do internal error handling, so if `s2` emits an
|
|
57
|
+
error in the above scenario, it will not trigger a `proccess.on('uncaughtException')` if you do not listen for it.
|
|
58
|
+
|
|
59
|
+
If you want to return a stream that combines *both* s1 and s2 to a single stream use
|
|
60
|
+
[pumpify](https://github.com/mafintosh/pumpify) instead.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
|
|
69
|
+
|
|
70
|
+
## For enterprise
|
|
71
|
+
|
|
72
|
+
Available as part of the Tidelift Subscription.
|
|
73
|
+
|
|
74
|
+
The maintainers of pump and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-pump?utm_source=npm-pump&utm_medium=referral&utm_campaign=enterprise)
|