bare-tty 2.1.4 → 3.0.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/binding.c CHANGED
@@ -245,10 +245,8 @@ bare_tty_init (js_env_t *env, js_callback_info_t *info) {
245
245
 
246
246
  err = uv_stream_set_blocking((uv_stream_t *) &tty->handle, true);
247
247
 
248
- if (err < 0) {
249
- js_throw_error(env, uv_err_name(err), uv_strerror(err));
250
- return NULL;
251
- }
248
+ // Not all platforms support blocking TTY handles.
249
+ (void) err;
252
250
 
253
251
  tty->env = env;
254
252
 
@@ -423,10 +421,9 @@ bare_tty_close (js_env_t *env, js_callback_info_t *info) {
423
421
 
424
422
  err = uv_tty_set_mode(&tty->handle, UV_TTY_MODE_NORMAL);
425
423
 
426
- if (err < 0) {
427
- js_throw_error(env, uv_err_name(err), uv_strerror(err));
428
- return NULL;
429
- }
424
+ // Resetting the mode won't always work, in particular on Windows when we
425
+ // close an output stream.
426
+ (void) err;
430
427
 
431
428
  uv_close((uv_handle_t *) &tty->handle, on_close);
432
429
 
package/binding.js CHANGED
@@ -1 +1 @@
1
- module.exports = process.addon(__dirname)
1
+ module.exports = require.addon()
package/index.js CHANGED
@@ -214,7 +214,7 @@ exports.constants = {
214
214
  MODE_IO: binding.MODE_IO || 0
215
215
  }
216
216
 
217
- process
217
+ Bare
218
218
  .on('exit', () => {
219
219
  for (const stream of exports.ReadStream._streams) {
220
220
  stream.destroy()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-tty",
3
- "version": "2.1.4",
3
+ "version": "3.0.0",
4
4
  "description": "Native TTY streams for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "https://github.com/holepunchto/bare-tty.git"
18
+ "url": "git+https://github.com/holepunchto/bare-tty.git"
19
19
  },
20
20
  "author": "Holepunch",
21
21
  "license": "Apache-2.0",