fsevents 1.2.4 → 1.2.9

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.

Potentially problematic release.


This version of fsevents might be problematic. Click here for more details.

Files changed (181) hide show
  1. package/.travis.yml +2 -3
  2. package/fsevents.cc +14 -26
  3. package/node_modules/abbrev/package.json +3 -4
  4. package/node_modules/ansi-regex/package.json +2 -2
  5. package/node_modules/aproba/package.json +2 -2
  6. package/node_modules/are-we-there-yet/CHANGES.md +6 -0
  7. package/node_modules/are-we-there-yet/package.json +14 -14
  8. package/node_modules/are-we-there-yet/tracker-stream.js +1 -0
  9. package/node_modules/balanced-match/package.json +2 -2
  10. package/node_modules/brace-expansion/package.json +2 -2
  11. package/node_modules/chownr/chownr.js +74 -38
  12. package/node_modules/chownr/package.json +17 -14
  13. package/node_modules/code-point-at/package.json +2 -2
  14. package/node_modules/concat-map/package.json +2 -2
  15. package/node_modules/console-control-strings/package.json +2 -2
  16. package/node_modules/core-util-is/package.json +2 -2
  17. package/node_modules/debug/CHANGELOG.md +34 -1
  18. package/node_modules/debug/README.md +206 -63
  19. package/node_modules/debug/dist/debug.js +912 -0
  20. package/node_modules/debug/package.json +41 -27
  21. package/node_modules/debug/src/browser.js +185 -106
  22. package/node_modules/debug/src/common.js +266 -0
  23. package/node_modules/debug/src/index.js +4 -4
  24. package/node_modules/debug/src/node.js +174 -165
  25. package/node_modules/deep-extend/CHANGELOG.md +8 -0
  26. package/node_modules/deep-extend/README.md +0 -2
  27. package/node_modules/deep-extend/package.json +20 -18
  28. package/node_modules/delegates/package.json +2 -2
  29. package/node_modules/detect-libc/package.json +2 -2
  30. package/node_modules/fs-minipass/package.json +2 -2
  31. package/node_modules/fs.realpath/package.json +2 -2
  32. package/node_modules/gauge/package.json +2 -2
  33. package/node_modules/glob/package.json +13 -13
  34. package/node_modules/has-unicode/package.json +2 -2
  35. package/node_modules/iconv-lite/Changelog.md +16 -0
  36. package/node_modules/iconv-lite/encodings/sbcs-codec.js +2 -2
  37. package/node_modules/iconv-lite/encodings/sbcs-data.js +5 -0
  38. package/node_modules/iconv-lite/lib/extend-node.js +1 -1
  39. package/node_modules/iconv-lite/lib/index.d.ts +2 -2
  40. package/node_modules/iconv-lite/package.json +14 -14
  41. package/node_modules/ignore-walk/package.json +2 -2
  42. package/node_modules/inflight/package.json +2 -2
  43. package/node_modules/inherits/package.json +3 -5
  44. package/node_modules/ini/package.json +2 -2
  45. package/node_modules/is-fullwidth-code-point/package.json +2 -2
  46. package/node_modules/isarray/package.json +2 -2
  47. package/node_modules/minimatch/package.json +2 -2
  48. package/node_modules/minimist/package.json +2 -2
  49. package/node_modules/minipass/LICENSE +15 -0
  50. package/node_modules/minipass/README.md +81 -3
  51. package/node_modules/minipass/index.js +77 -6
  52. package/node_modules/minipass/package.json +14 -14
  53. package/node_modules/minizlib/index.js +66 -95
  54. package/node_modules/minizlib/package.json +13 -13
  55. package/node_modules/mkdirp/package.json +2 -3
  56. package/node_modules/ms/index.js +28 -18
  57. package/node_modules/ms/package.json +17 -17
  58. package/node_modules/ms/readme.md +17 -8
  59. package/node_modules/needle/.npmignore +6 -0
  60. package/node_modules/needle/README.md +3 -3
  61. package/node_modules/needle/examples/multipart-stream.js +1 -1
  62. package/node_modules/needle/lib/auth.js +1 -1
  63. package/node_modules/needle/lib/cookies.js +12 -10
  64. package/node_modules/needle/lib/multipart.js +1 -1
  65. package/node_modules/needle/lib/needle.js +18 -6
  66. package/node_modules/needle/package-lock.json +395 -0
  67. package/node_modules/needle/package.json +21 -21
  68. package/node_modules/needle/test/basic_auth_spec.js +1 -1
  69. package/node_modules/needle/test/cookies_spec.js +2 -2
  70. package/node_modules/needle/test/errors_spec.js +4 -4
  71. package/node_modules/needle/test/keys/ssl.cert +21 -0
  72. package/node_modules/needle/test/keys/ssl.key +27 -0
  73. package/node_modules/needle/test/long_string_spec.js +1 -1
  74. package/node_modules/needle/test/output_spec.js +1 -1
  75. package/node_modules/needle/test/post_data_spec.js +20 -20
  76. package/node_modules/needle/test/proxy_spec.js +1 -1
  77. package/node_modules/needle/test/url_spec.js +11 -3
  78. package/node_modules/needle/test/utils/test.js +1 -1
  79. package/node_modules/node-pre-gyp/CHANGELOG.md +23 -0
  80. package/node_modules/node-pre-gyp/README.md +44 -12
  81. package/node_modules/node-pre-gyp/appveyor.yml +0 -2
  82. package/node_modules/node-pre-gyp/lib/build.js +1 -1
  83. package/node_modules/node-pre-gyp/lib/install.js +42 -8
  84. package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
  85. package/node_modules/node-pre-gyp/lib/pre-binding.js +5 -5
  86. package/node_modules/node-pre-gyp/lib/rebuild.js +1 -1
  87. package/node_modules/node-pre-gyp/lib/reinstall.js +1 -1
  88. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +96 -0
  89. package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +5 -2
  90. package/node_modules/node-pre-gyp/lib/util/napi.js +70 -22
  91. package/node_modules/node-pre-gyp/lib/util/versioning.js +7 -6
  92. package/node_modules/node-pre-gyp/package.json +19 -17
  93. package/node_modules/nopt/package.json +2 -2
  94. package/node_modules/npm-bundled/LICENSE +15 -0
  95. package/node_modules/npm-bundled/README.md +2 -0
  96. package/node_modules/npm-bundled/index.js +16 -2
  97. package/node_modules/npm-bundled/package.json +13 -13
  98. package/node_modules/npm-packlist/index.js +43 -13
  99. package/node_modules/npm-packlist/package.json +13 -13
  100. package/node_modules/npmlog/package.json +2 -2
  101. package/node_modules/number-is-nan/package.json +2 -2
  102. package/node_modules/object-assign/package.json +2 -2
  103. package/node_modules/once/package.json +2 -2
  104. package/node_modules/os-homedir/package.json +2 -2
  105. package/node_modules/os-tmpdir/package.json +2 -2
  106. package/node_modules/osenv/package.json +2 -2
  107. package/node_modules/path-is-absolute/package.json +2 -2
  108. package/node_modules/process-nextick-args/package.json +2 -2
  109. package/node_modules/rc/node_modules/minimist/package.json +2 -2
  110. package/node_modules/rc/package.json +17 -16
  111. package/node_modules/readable-stream/package.json +2 -2
  112. package/node_modules/rimraf/package.json +17 -14
  113. package/node_modules/safe-buffer/index.d.ts +187 -0
  114. package/node_modules/safe-buffer/package.json +15 -15
  115. package/node_modules/safer-buffer/package.json +2 -2
  116. package/node_modules/sax/package.json +2 -2
  117. package/node_modules/semver/CHANGELOG.md +39 -0
  118. package/node_modules/semver/README.md +31 -8
  119. package/node_modules/semver/bin/semver +92 -75
  120. package/node_modules/semver/package.json +20 -14
  121. package/node_modules/semver/semver.js +922 -763
  122. package/node_modules/set-blocking/package.json +2 -2
  123. package/node_modules/signal-exit/package.json +2 -2
  124. package/node_modules/string-width/package.json +2 -2
  125. package/node_modules/string_decoder/package.json +2 -2
  126. package/node_modules/strip-ansi/package.json +2 -2
  127. package/node_modules/strip-json-comments/package.json +2 -2
  128. package/node_modules/tar/README.md +7 -2
  129. package/node_modules/tar/lib/header.js +20 -4
  130. package/node_modules/tar/lib/mode-fix.js +14 -0
  131. package/node_modules/tar/lib/pack.js +1 -0
  132. package/node_modules/tar/lib/parse.js +2 -1
  133. package/node_modules/tar/lib/unpack.js +67 -6
  134. package/node_modules/tar/lib/write-entry.js +25 -6
  135. package/node_modules/tar/package.json +20 -20
  136. package/node_modules/util-deprecate/package.json +2 -2
  137. package/node_modules/wide-align/package.json +14 -14
  138. package/node_modules/wrappy/package.json +2 -2
  139. package/node_modules/yallist/iterator.js +5 -5
  140. package/node_modules/yallist/package.json +13 -13
  141. package/node_modules/yallist/yallist.js +2 -2
  142. package/package.json +6 -9
  143. package/src/async.cc +2 -2
  144. package/src/constants.cc +20 -20
  145. package/src/thread.cc +5 -6
  146. package/build/.target.mk +0 -55
  147. package/build/Makefile +0 -352
  148. package/build/Release/.deps/Release/.node.d +0 -1
  149. package/build/Release/.deps/Release/fse.node.d +0 -1
  150. package/build/Release/.deps/Release/obj.target/action_after_build.stamp.d +0 -1
  151. package/build/Release/.deps/Release/obj.target/fse/fsevents.o.d +0 -67
  152. package/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node.d +0 -1
  153. package/build/Release/.node +0 -0
  154. package/build/Release/fse.node +0 -0
  155. package/build/Release/obj.target/action_after_build.stamp +0 -0
  156. package/build/Release/obj.target/fse/fsevents.o +0 -0
  157. package/build/action_after_build.target.mk +0 -32
  158. package/build/binding.Makefile +0 -6
  159. package/build/fse.target.mk +0 -184
  160. package/build/gyp-mac-tool +0 -611
  161. package/lib/binding/Release/node-v11-darwin-x64/fse.node +0 -0
  162. package/lib/binding/Release/node-v46-darwin-x64/fse.node +0 -0
  163. package/lib/binding/Release/node-v47-darwin-x64/fse.node +0 -0
  164. package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
  165. package/lib/binding/Release/node-v57-darwin-x64/fse.node +0 -0
  166. package/lib/binding/Release/node-v64-darwin-x64/fse.node +0 -0
  167. package/node_modules/are-we-there-yet/CHANGES.md~ +0 -27
  168. package/node_modules/debug/.coveralls.yml +0 -1
  169. package/node_modules/debug/.eslintrc +0 -11
  170. package/node_modules/debug/.npmignore +0 -9
  171. package/node_modules/debug/.travis.yml +0 -14
  172. package/node_modules/debug/Makefile +0 -50
  173. package/node_modules/debug/component.json +0 -19
  174. package/node_modules/debug/karma.conf.js +0 -70
  175. package/node_modules/debug/node.js +0 -1
  176. package/node_modules/debug/src/debug.js +0 -202
  177. package/node_modules/debug/src/inspector-log.js +0 -15
  178. package/node_modules/iconv-lite/.travis.yml +0 -23
  179. package/node_modules/safe-buffer/.travis.yml +0 -7
  180. package/node_modules/safe-buffer/test.js +0 -101
  181. package/src/locking.cc +0 -27
@@ -10,7 +10,7 @@ multiparts.push(['Content-Disposition: form-data; name=\"foo\"'])
10
10
  multiparts.push(['\r\nbar\r\n----------------------NODENEEDLEHTTPCLIENT--'])
11
11
  // multiparts.push(['Content-Disposition: form-data; name=\"test\"'])
12
12
  // multiparts.push(['\r\næµè¯\r\n----------------------NODENEEDLEHTTPCLIENT--'])
13
- // multiparts.push(['\r\n' + new Buffer('测试').toString() + '\r\n----------------------NODENEEDLEHTTPCLIENT--'])
13
+ // multiparts.push(['\r\n' + Buffer.from('测试').toString() + '\r\n----------------------NODENEEDLEHTTPCLIENT--'])
14
14
 
15
15
 
16
16
  describe('post data (e.g. request body)', function() {
@@ -150,7 +150,7 @@ describe('post data (e.g. request body)', function() {
150
150
  spy.called.should.be.true;
151
151
 
152
152
  spy.args[0][0].should.be.an.instanceof(String);
153
- new Buffer(spy.args[0][0]).toString('hex').should.eql('2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d22666f6f220d0a0d0a6261720d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2274657374220d0a0d0ac3a6c2b5c28bc3a8c2afc2950d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e542d2d')
153
+ Buffer.from(spy.args[0][0]).toString('hex').should.eql('2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d22666f6f220d0a0d0a6261720d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2274657374220d0a0d0ac3a6c2b5c28bc3a8c2afc2950d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e542d2d')
154
154
  done();
155
155
  })
156
156
  })
@@ -187,7 +187,7 @@ describe('post data (e.g. request body)', function() {
187
187
  post({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
188
188
  spy.called.should.be.true;
189
189
  spy.args[0][0].should.be.an.instanceof(String);
190
- new Buffer(spy.args[0][0]).toString('hex').should.eql('2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d22666f6f220d0a0d0a6261720d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2274657374220d0a0d0ac3a6c2b5c28bc3a8c2afc2950d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e542d2d')
190
+ Buffer.from(spy.args[0][0]).toString('hex').should.eql('2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d22666f6f220d0a0d0a6261720d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2274657374220d0a0d0ac3a6c2b5c28bc3a8c2afc2950d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e542d2d')
191
191
  done();
192
192
  })
193
193
  })
@@ -761,14 +761,14 @@ describe('post data (e.g. request body)', function() {
761
761
  it('sends request', function(done) {
762
762
  spystub_request();
763
763
 
764
- get(new Buffer('foobar'), { json: false }, function(err, resp) {
764
+ get(Buffer.from('foobar'), { json: false }, function(err, resp) {
765
765
  check_request('get');
766
766
  done();
767
767
  })
768
768
  })
769
769
 
770
770
  it('sets Content-Type header', function(done) {
771
- get(new Buffer('foobar'), { json: false }, function(err, resp) {
771
+ get(Buffer.from('foobar'), { json: false }, function(err, resp) {
772
772
  // should.not.exist(resp.body.headers['content-type']);
773
773
  resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
774
774
 
@@ -777,7 +777,7 @@ describe('post data (e.g. request body)', function() {
777
777
  })
778
778
 
779
779
  it('doesnt change default Accept header', function(done) {
780
- get(new Buffer('foobar'), { json: false }, function(err, resp) {
780
+ get(Buffer.from('foobar'), { json: false }, function(err, resp) {
781
781
  // resp.body contains 'header' and 'body', mirroring what we sent
782
782
  resp.body.headers['accept'].should.equal('*/*');
783
783
  done();
@@ -785,7 +785,7 @@ describe('post data (e.g. request body)', function() {
785
785
  })
786
786
 
787
787
  it('writes as buffer', function(done) {
788
- get(new Buffer('foobar'), { json: false }, function(err, resp) {
788
+ get(Buffer.from('foobar'), { json: false }, function(err, resp) {
789
789
  spy.called.should.be.true;
790
790
  spy.args[0][0].should.be.an.instanceof(Buffer);
791
791
  spy.args[0][0].toString().should.equal('foobar');
@@ -801,28 +801,28 @@ describe('post data (e.g. request body)', function() {
801
801
  it('sends request, without setting a querystring', function(done) {
802
802
  spystub_request();
803
803
 
804
- get(new Buffer('foobar'), { json: true }, function(err, resp) {
804
+ get(Buffer.from('foobar'), { json: true }, function(err, resp) {
805
805
  check_request('get');
806
806
  done();
807
807
  })
808
808
  })
809
809
 
810
810
  it('sets Content-Type header', function(done) {
811
- get(new Buffer('foobar'), { json: true }, function(err, resp) {
811
+ get(Buffer.from('foobar'), { json: true }, function(err, resp) {
812
812
  resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
813
813
  done();
814
814
  })
815
815
  })
816
816
 
817
817
  it('set Accept header to application/json', function(done) {
818
- get(new Buffer('foobar'), { json: true }, function(err, resp) {
818
+ get(Buffer.from('foobar'), { json: true }, function(err, resp) {
819
819
  resp.body.headers['accept'].should.equal('application/json');
820
820
  done();
821
821
  })
822
822
  })
823
823
 
824
824
  it('writes JSON.stringify version of object', function(done) {
825
- get(new Buffer('foobar'), { json: true }, function(err, resp) {
825
+ get(Buffer.from('foobar'), { json: true }, function(err, resp) {
826
826
  spy.called.should.be.true;
827
827
  spy.args[0][0].toString().should.eql('foobar')
828
828
  resp.body.body.should.eql('foobar');
@@ -841,21 +841,21 @@ describe('post data (e.g. request body)', function() {
841
841
  it('sends request', function(done) {
842
842
  spystub_request();
843
843
 
844
- post(new Buffer('foobar'), { json: false }, function(err, resp) {
844
+ post(Buffer.from('foobar'), { json: false }, function(err, resp) {
845
845
  check_request('post');
846
846
  done();
847
847
  })
848
848
  })
849
849
 
850
850
  it('sets Content-Type header to www-form-urlencoded', function(done) {
851
- post(new Buffer('foobar'), { json: false }, function(err, resp) {
851
+ post(Buffer.from('foobar'), { json: false }, function(err, resp) {
852
852
  resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
853
853
  done();
854
854
  })
855
855
  })
856
856
 
857
857
  it('doesnt change default Accept header', function(done) {
858
- post(new Buffer('foobar'), { json: false }, function(err, resp) {
858
+ post(Buffer.from('foobar'), { json: false }, function(err, resp) {
859
859
  // resp.body contains 'header' and 'body', mirroring what we sent
860
860
  resp.body.headers['accept'].should.equal('*/*');
861
861
  done();
@@ -863,7 +863,7 @@ describe('post data (e.g. request body)', function() {
863
863
  })
864
864
 
865
865
  it('writes as buffer', function(done) {
866
- post(new Buffer('foobar'), { json: false }, function(err, resp) {
866
+ post(Buffer.from('foobar'), { json: false }, function(err, resp) {
867
867
  spy.called.should.be.true;
868
868
  spy.args[0][0].should.be.an.instanceof(Buffer);
869
869
  spy.args[0][0].toString().should.equal('foobar');
@@ -879,28 +879,28 @@ describe('post data (e.g. request body)', function() {
879
879
  it('sends request', function(done) {
880
880
  spystub_request();
881
881
 
882
- post(new Buffer('foobar'), { json: true }, function(err, resp) {
882
+ post(Buffer.from('foobar'), { json: true }, function(err, resp) {
883
883
  check_request('post');
884
884
  done();
885
885
  })
886
886
  })
887
887
 
888
888
  it('sets Content-Type header', function(done) {
889
- post(new Buffer('foobar'), { json: true }, function(err, resp) {
889
+ post(Buffer.from('foobar'), { json: true }, function(err, resp) {
890
890
  resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
891
891
  done();
892
892
  })
893
893
  })
894
894
 
895
895
  it('set Accept header to application/json', function(done) {
896
- post(new Buffer('foobar'), { json: true }, function(err, resp) {
896
+ post(Buffer.from('foobar'), { json: true }, function(err, resp) {
897
897
  resp.body.headers['accept'].should.equal('application/json');
898
898
  done();
899
899
  })
900
900
  })
901
901
 
902
902
  it('passes raw buffer (assuming its a JSON string beneath)', function(done) {
903
- post(new Buffer('foobar'), { json: true }, function(err, resp) {
903
+ post(Buffer.from('foobar'), { json: true }, function(err, resp) {
904
904
  spy.called.should.be.true;
905
905
  spy.args[0][0].toString().should.eql('foobar')
906
906
  resp.body.body.should.eql('foobar');
@@ -1018,4 +1018,4 @@ describe('post data (e.g. request body)', function() {
1018
1018
 
1019
1019
  })
1020
1020
 
1021
- })
1021
+ })
@@ -51,7 +51,7 @@ describe('proxy option', function() {
51
51
 
52
52
  function get_auth(header) {
53
53
  var token = header.split(/\s+/).pop();
54
- return token && new Buffer(token, 'base64').toString().split(':');
54
+ return token && Buffer.from(token, 'base64').toString().split(':');
55
55
  }
56
56
 
57
57
  function no_proxy_auth(done) {
@@ -38,10 +38,18 @@ describe('urls', function() {
38
38
  url = 'foo://google.com/what'
39
39
  })
40
40
 
41
- it('fails', function(done) {
42
- send_request(function(err){
41
+ it('does not throw', function(done) {
42
+ (function() {
43
+ send_request(function(err) {
44
+ done();
45
+ })
46
+ }).should.not.throw()
47
+ })
48
+
49
+ it('returns an error', function(done) {
50
+ send_request(function(err) {
43
51
  err.should.be.an.Error;
44
- err.code.should.eql('ENOTFOUND');
52
+ err.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
45
53
  done();
46
54
  })
47
55
  })
@@ -46,7 +46,7 @@ function multipart_post(url){
46
46
  var data = 'Plain text data.\nLorem ipsum dolor sit amet.\nBla bla bla.\n';
47
47
  fs.writeFileSync(filename, data);
48
48
 
49
- var black_pixel = new Buffer("data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=".replace(/^data:image\/\w+;base64,/, ""), "base64");
49
+ var black_pixel = Buffer.from("data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=".replace(/^data:image\/\w+;base64,/, ""), "base64");
50
50
 
51
51
  var data = {
52
52
  foo: 'bar',
@@ -1,5 +1,28 @@
1
1
  # node-pre-gyp changelog
2
2
 
3
+ ## 0.12.0
4
+
5
+ - Fixed double-build problem with node v10 (https://github.com/mapbox/node-pre-gyp/pull/428)
6
+ - Added node 11 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/422)
7
+
8
+ ## 0.11.0
9
+
10
+ - Fixed double-install problem with node v10
11
+ - Significant N-API improvements (https://github.com/mapbox/node-pre-gyp/pull/405)
12
+
13
+ ## 0.10.3
14
+
15
+ - Now will use `request` over `needle` if request is installed. By default `needle` is used for `https`. This should unbreak proxy support that regressed in v0.9.0
16
+
17
+ ## 0.10.2
18
+
19
+ - Fixed rc/deep-extent security vulnerability
20
+ - Fixed broken reinstall script do to incorrectly named get_best_napi_version
21
+
22
+ ## 0.10.1
23
+
24
+ - Fix needle error event (@medns)
25
+
3
26
  ## 0.10.0
4
27
 
5
28
  - Allow for a single-level module path when packing @allenluce (https://github.com/mapbox/node-pre-gyp/pull/371)
@@ -82,7 +82,7 @@ Both `--build-from-source` and `--fallback-to-build` can be passed alone or they
82
82
 
83
83
  For example: `npm install --build-from-source=myapp`. This is useful if:
84
84
 
85
- - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependent with `npm install`.
85
+ - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependency with `npm install`.
86
86
  - The larger app also depends on other modules installed with `node-pre-gyp`
87
87
  - You only want to trigger a source compile for `myapp` and the other modules.
88
88
 
@@ -106,7 +106,6 @@ This looks like:
106
106
  "devDependencies": {
107
107
  "aws-sdk": "2.x"
108
108
  }
109
- "bundledDependencies":["node-pre-gyp"],
110
109
  "scripts": {
111
110
  "install": "node-pre-gyp install --fallback-to-build"
112
111
  },
@@ -123,12 +122,10 @@ Let's break this down:
123
122
 
124
123
  - Dependencies need to list `node-pre-gyp`
125
124
  - Your devDependencies should list `aws-sdk` so that you can run `node-pre-gyp publish` locally or a CI system. We recommend using `devDependencies` only since `aws-sdk` is large and not needed for `node-pre-gyp install` since it only uses http to fetch binaries
126
- - You should add `"bundledDependencies":["node-pre-gyp"]`. This ensures that when you publish your module that the correct version of node-pre-gyp will be included in the `node_modules` folder during publishing. Then when uses install your module `node-pre-gyp` will already be present. Without this your module will not be safely installable for downstream applications that have a depedency on node-pre-gyp in the npm tree (without bundling npm deduping might break the install when node-pre-gyp is moved in flight)
127
- - Your `scripts` section should optionally add `"prepublishOnly": "npm ls"` to ensure the right node-pre-gyp version is bundled before publishing your module. If node-pre-gyp is missing or an old version is present then this will catch that error before you publish a broken package.
128
125
  - Your `scripts` section should override the `install` target with `"install": "node-pre-gyp install --fallback-to-build"`. This allows node-pre-gyp to be used instead of the default npm behavior of always source compiling with `node-gyp` directly.
129
126
  - Your package.json should contain a `binary` section describing key properties you provide to allow node-pre-gyp to package optimally. They are detailed below.
130
127
 
131
- Note: in the past we recommended using `"preinstall": "npm install node-pre-gyp"` as an alternative method to avoid needing to bundle. But this does not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. Instead we recommend bundling. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908.
128
+ Note: in the past we recommended putting `node-pre-gyp` in the `bundledDependencies`, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case. Also, for a time we recommended using `"preinstall": "npm install node-pre-gyp"` as an alternative method to avoid needing to bundle. But this did not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908.
132
129
 
133
130
  ##### The `binary` object has three required properties
134
131
 
@@ -156,7 +153,7 @@ It is highly recommended that you use Amazon S3. The reasons are:
156
153
  - S3 is a very solid hosting platform for distributing large files.
157
154
  - We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp.
158
155
 
159
- Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-s3 location then it should be possible.
156
+ Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-S3 location then it should be possible.
160
157
 
161
158
  It should also be mentioned that there is an optional and entirely separate npm module called [node-pre-gyp-github](https://github.com/bchr02/node-pre-gyp-github) which is intended to complement node-pre-gyp and be installed along with it. It provides the ability to store and publish your binaries within your repositories GitHub Releases if you would rather not use S3 directly. Installation and usage instructions can be found [here](https://github.com/bchr02/node-pre-gyp-github), but the basic premise is that instead of using the ```node-pre-gyp publish``` command you would use ```node-pre-gyp-github publish```.
162
159
 
@@ -312,30 +309,32 @@ When the `napi_versions` array property is present, `node-pre-gyp` fires off mul
312
309
 
313
310
  ### The `napi_build_version` value
314
311
 
315
- For each of the N-API module operations `node-pre-gyp` initiates, it insures that the `napi_build_version` is set appropriately.
312
+ For each of the N-API module operations `node-pre-gyp` initiates, it ensures that the `napi_build_version` is set appropriately.
316
313
 
317
314
  This value is of importance in two areas:
318
315
 
319
316
  1. The C/C++ code which needs to know against which N-API version it should compile.
320
317
  2. `node-pre-gyp` itself which must assign appropriate path and file names to avoid collisions.
321
318
 
322
- ### Defining `NAPI_BUILD_VERSION` for the C/C++ code
319
+ ### Defining `NAPI_VERSION` for the C/C++ code
323
320
 
324
321
  The `napi_build_version` value is communicated to the C/C++ code by adding this code to the `binding.gyp` file:
325
322
 
326
323
  ```
327
324
  "defines": [
328
- "NAPI_BUILD_VERSION=<(napi_build_version)",
325
+ "NAPI_VERSION=<(napi_build_version)",
329
326
  ]
330
327
  ```
331
328
 
332
- This insures that `NAPI_BUILD_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build.
329
+ This ensures that `NAPI_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build.
330
+
331
+ > Note that earlier versions of this document recommended defining the symbol `NAPI_BUILD_VERSION`. `NAPI_VERSION` is prefered because it used by the N-API C/C++ headers to configure the specific N-API veriosn being requested.
333
332
 
334
333
  ### Path and file naming requirements in `package.json`
335
334
 
336
335
  Since `node-pre-gyp` fires off multiple operations for each request, it is essential that path and file names be created in such a way as to avoid collisions. This is accomplished by imposing additional path and file naming requirements.
337
336
 
338
- Specifically, when performing N-API builds, the `{napi_build_version}` text substitution string *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text substitution string *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.)
337
+ Specifically, when performing N-API builds, the `{napi_build_version}` text configuration value *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text configuration value *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.)
339
338
 
340
339
  Here's an example:
341
340
 
@@ -350,9 +349,42 @@ Here's an example:
350
349
  }
351
350
  ```
352
351
 
352
+ ## Supporting both N-API and NAN builds
353
+
354
+ You may have a legacy native add-on that you wish to continue supporting for those versions of Node that do not support N-API, as you add N-API support for later Node versions. This can be accomplished by specifying the `node_napi_label` configuration value in the package.json `binary.package_name` property.
355
+
356
+ Placing the configuration value `node_napi_label` in the package.json `binary.package_name` property instructs `node-pre-gyp` to build all viable N-API binaries supported by the current Node instance. If the current Node instance does not support N-API, `node-pre-gyp` will request a traditional, non-N-API build.
357
+
358
+ The configuration value `node_napi_label` is set by `node-pre-gyp` to the type of build created, `napi` or `node`, and the version number. For N-API builds, the string contains the N-API version nad has values like `napi-v3`. For traditional, non-N-API builds, the string contains the ABI version with values like `node-v46`.
359
+
360
+ Here's how the `binary` configuration above might be changed to support both N-API and NAN builds:
361
+
362
+ ```js
363
+ "binary": {
364
+ "module_name": "your_module",
365
+ "module_path": "./lib/binding/{node_napi_label}",
366
+ "remote_path": "./{module_name}/v{version}/{configuration}/",
367
+ "package_name": "{platform}-{arch}-{node_napi_label}.tar.gz",
368
+ "host": "https://your_bucket.s3-us-west-1.amazonaws.com",
369
+ "napi_versions": [1,3]
370
+ }
371
+ ```
372
+
373
+ The C/C++ symbol `NAPI_VERSION` can be used to distinguish N-API and non-N-API builds. The value of `NAPI_VERSION` is set to the integer N-API version for N-API builds and is set to `0` for non-N-API builds.
374
+
375
+ For example:
376
+
377
+ ```C
378
+ #if NAPI_VERSION
379
+ // N-API code goes here
380
+ #else
381
+ // NAN code goes here
382
+ #endif
383
+ ```
384
+
353
385
  ### Two additional configuration values
354
386
 
355
- For those who need them in legacy projects, two additional configuration values are available for all builds.
387
+ The following two configuration values, which were implemented in previous versions of `node-pre-gyp`, continue to exist, but have been replaced by the `node_napi_label` configuration value described above.
356
388
 
357
389
  1. `napi_version` If N-API is supported by the currently executing Node instance, this value is the N-API version number supported by Node. If N-API is not supported, this value is an empty string.
358
390
 
@@ -3,8 +3,6 @@ os: Visual Studio 2015
3
3
  environment:
4
4
  matrix:
5
5
  - nodejs_version: 6
6
- - nodejs_version: 8
7
- - nodejs_version: 9
8
6
  - nodejs_version: 10
9
7
 
10
8
  platform:
@@ -21,7 +21,7 @@ function do_build(gyp,argv,callback) {
21
21
  napi.swap_build_dir_in(result.opts.napi_build_version);
22
22
  }
23
23
  compile.run_gyp(final_args,result.opts,function(err) {
24
- if (!err && result.opts.napi_build_version) {
24
+ if (result.opts.napi_build_version) {
25
25
  napi.swap_build_dir_out(result.opts.napi_build_version);
26
26
  }
27
27
  return callback(err);
@@ -19,6 +19,21 @@ try {
19
19
  npgVersion = JSON.parse(ownPackageJSON).version;
20
20
  } catch (e) {}
21
21
 
22
+ var http_get = {
23
+ impl: undefined,
24
+ type: undefined
25
+ };
26
+
27
+ try {
28
+ http_get.impl = require('request');
29
+ http_get.type = 'request';
30
+ log.warn("Using request for node-pre-gyp https download");
31
+ } catch (e) {
32
+ http_get.impl = require('needle');
33
+ http_get.type = 'needle';
34
+ log.warn("Using needle for node-pre-gyp https download");
35
+ }
36
+
22
37
  function download(uri,opts,callback) {
23
38
  log.http('GET', uri);
24
39
 
@@ -59,7 +74,7 @@ function download(uri,opts,callback) {
59
74
  }
60
75
  }
61
76
  try {
62
- req = require('needle').get(requestOpts.uri, requestOpts);
77
+ req = http_get.impl.get(requestOpts.uri, requestOpts);
63
78
  } catch (e) {
64
79
  return callback(e);
65
80
  }
@@ -77,6 +92,7 @@ function place_binary(from,to,opts,callback) {
77
92
  if (!req) return callback(new Error("empty req"));
78
93
  var badDownload = false;
79
94
  var extractCount = 0;
95
+ var hasResponse = false;
80
96
  var tar = require('tar');
81
97
 
82
98
  function afterTarball(err) {
@@ -94,23 +110,41 @@ function place_binary(from,to,opts,callback) {
94
110
  extractCount++;
95
111
  }
96
112
 
113
+ // for request compatibility
97
114
  req.on('error', function(err) {
98
115
  badDownload = true;
99
- return callback(err);
116
+ if (!hasResponse) {
117
+ hasResponse = true;
118
+ return callback(err);
119
+ }
120
+ });
121
+
122
+ // for needle compatibility
123
+ req.on('err', function(err) {
124
+ badDownload = true;
125
+ if (!hasResponse) {
126
+ hasResponse = true;
127
+ return callback(err);
128
+ }
100
129
  });
101
130
 
102
131
  req.on('close', function () {
103
- if (extractCount === 0) {
132
+ if (!hasResponse) {
133
+ hasResponse = true;
104
134
  return callback(new Error('Connection closed while downloading tarball file'));
105
135
  }
106
136
  });
107
137
 
108
138
  req.on('response', function(res) {
109
- // ignore redirects, needle handles these automatically.
110
- if (res.headers.hasOwnProperty('location') && res.headers.location !== '') {
111
- return;
112
- }
113
- if (res.statusCode !== 200) {
139
+ // ignore redirects, needle handles these automatically.
140
+ if (http_get.type === 'needle' && res.headers.hasOwnProperty('location') && res.headers.location !== '') {
141
+ return;
142
+ }
143
+ if (hasResponse) {
144
+ return;
145
+ }
146
+ hasResponse = true;
147
+ if (res.statusCode !== 200) {
114
148
  badDownload = true;
115
149
  var err = new Error(res.statusCode + ' status code downloading tarball ' + from);
116
150
  err.statusCode = res.statusCode;
@@ -135,7 +135,7 @@ proto.parseArgv = function parseOpts (argv) {
135
135
  if (dir == null) dir = process.cwd();
136
136
  var package_json = JSON.parse(fs.readFileSync(path.join(dir,'package.json')));
137
137
 
138
- this.todo = napi.expand_commands (package_json, commands);
138
+ this.todo = napi.expand_commands (package_json, this.opts, commands);
139
139
 
140
140
  // support for inheriting config env variables from npm
141
141
  var npm_config_prefix = 'npm_config_';
@@ -9,8 +9,8 @@ module.exports = exports;
9
9
 
10
10
  exports.usage = 'Finds the require path for the node-pre-gyp installed module';
11
11
 
12
- exports.validate = function(package_json) {
13
- versioning.validate_config(package_json);
12
+ exports.validate = function(package_json,opts) {
13
+ versioning.validate_config(package_json,opts);
14
14
  };
15
15
 
16
16
  exports.find = function(package_json_path,opts) {
@@ -18,10 +18,10 @@ exports.find = function(package_json_path,opts) {
18
18
  throw new Error("package.json does not exist at " + package_json_path);
19
19
  }
20
20
  var package_json = require(package_json_path);
21
- versioning.validate_config(package_json);
21
+ versioning.validate_config(package_json,opts);
22
22
  var napi_build_version;
23
- if (napi.get_napi_build_versions (package_json)) {
24
- napi_build_version = napi.get_best_napi_build_version(package_json);
23
+ if (napi.get_napi_build_versions (package_json, opts)) {
24
+ napi_build_version = napi.get_best_napi_build_version(package_json, opts);
25
25
  }
26
26
  opts = opts || {};
27
27
  if (!opts.module_root) opts.module_root = path.dirname(package_json_path);
@@ -13,7 +13,7 @@ function rebuild (gyp, argv, callback) {
13
13
  { name: 'clean', args: [] },
14
14
  { name: 'build', args: ['rebuild'] }
15
15
  ];
16
- commands = napi.expand_commands(package_json, commands);
16
+ commands = napi.expand_commands(package_json, gyp.opts, commands);
17
17
  for (var i = commands.length; i !== 0; i--) {
18
18
  gyp.todo.unshift(commands[i-1]);
19
19
  }
@@ -10,7 +10,7 @@ var napi = require('./util/napi.js');
10
10
  function rebuild (gyp, argv, callback) {
11
11
  var package_json = JSON.parse(fs.readFileSync('./package.json'));
12
12
  var installArgs = [];
13
- var napi_build_version = napi.get_best_napi_version(package_json);
13
+ var napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts);
14
14
  if (napi_build_version != null) installArgs = [ napi.get_command_arg (napi_build_version) ];
15
15
  gyp.todo.unshift(
16
16
  { name: 'clean', args: [] },
@@ -1499,6 +1499,14 @@
1499
1499
  "node_abi": 48,
1500
1500
  "v8": "5.1"
1501
1501
  },
1502
+ "6.14.3": {
1503
+ "node_abi": 48,
1504
+ "v8": "5.1"
1505
+ },
1506
+ "6.14.4": {
1507
+ "node_abi": 48,
1508
+ "v8": "5.1"
1509
+ },
1502
1510
  "7.0.0": {
1503
1511
  "node_abi": 51,
1504
1512
  "v8": "5.4"
@@ -1659,6 +1667,22 @@
1659
1667
  "node_abi": 57,
1660
1668
  "v8": "6.2"
1661
1669
  },
1670
+ "8.11.2": {
1671
+ "node_abi": 57,
1672
+ "v8": "6.2"
1673
+ },
1674
+ "8.11.3": {
1675
+ "node_abi": 57,
1676
+ "v8": "6.2"
1677
+ },
1678
+ "8.11.4": {
1679
+ "node_abi": 57,
1680
+ "v8": "6.2"
1681
+ },
1682
+ "8.12.0": {
1683
+ "node_abi": 57,
1684
+ "v8": "6.2"
1685
+ },
1662
1686
  "9.0.0": {
1663
1687
  "node_abi": 59,
1664
1688
  "v8": "6.2"
@@ -1727,8 +1751,80 @@
1727
1751
  "node_abi": 59,
1728
1752
  "v8": "6.2"
1729
1753
  },
1754
+ "9.11.2": {
1755
+ "node_abi": 59,
1756
+ "v8": "6.2"
1757
+ },
1730
1758
  "10.0.0": {
1731
1759
  "node_abi": 64,
1732
1760
  "v8": "6.6"
1761
+ },
1762
+ "10.1.0": {
1763
+ "node_abi": 64,
1764
+ "v8": "6.6"
1765
+ },
1766
+ "10.2.0": {
1767
+ "node_abi": 64,
1768
+ "v8": "6.6"
1769
+ },
1770
+ "10.2.1": {
1771
+ "node_abi": 64,
1772
+ "v8": "6.6"
1773
+ },
1774
+ "10.3.0": {
1775
+ "node_abi": 64,
1776
+ "v8": "6.6"
1777
+ },
1778
+ "10.4.0": {
1779
+ "node_abi": 64,
1780
+ "v8": "6.7"
1781
+ },
1782
+ "10.4.1": {
1783
+ "node_abi": 64,
1784
+ "v8": "6.7"
1785
+ },
1786
+ "10.5.0": {
1787
+ "node_abi": 64,
1788
+ "v8": "6.7"
1789
+ },
1790
+ "10.6.0": {
1791
+ "node_abi": 64,
1792
+ "v8": "6.7"
1793
+ },
1794
+ "10.7.0": {
1795
+ "node_abi": 64,
1796
+ "v8": "6.7"
1797
+ },
1798
+ "10.8.0": {
1799
+ "node_abi": 64,
1800
+ "v8": "6.7"
1801
+ },
1802
+ "10.9.0": {
1803
+ "node_abi": 64,
1804
+ "v8": "6.8"
1805
+ },
1806
+ "10.10.0": {
1807
+ "node_abi": 64,
1808
+ "v8": "6.8"
1809
+ },
1810
+ "10.11.0": {
1811
+ "node_abi": 64,
1812
+ "v8": "6.8"
1813
+ },
1814
+ "10.12.0": {
1815
+ "node_abi": 64,
1816
+ "v8": "6.8"
1817
+ },
1818
+ "10.13.0": {
1819
+ "node_abi": 64,
1820
+ "v8": "6.8"
1821
+ },
1822
+ "11.0.0": {
1823
+ "node_abi": 67,
1824
+ "v8": "7.0"
1825
+ },
1826
+ "11.1.0": {
1827
+ "node_abi": 67,
1828
+ "v8": "7.0"
1733
1829
  }
1734
1830
  }