unprint 0.19.0 → 0.19.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unprint",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "Simplify common web scraping tasks while staying in control of the data.",
5
5
  "main": "src/app.js",
6
6
  "repository": {
package/src/app.js CHANGED
@@ -22,7 +22,7 @@ const settings = {
22
22
  requestTimeout: 30000,
23
23
  userAgent: 'unprint',
24
24
  remote: {
25
- enabled: false,
25
+ enable: false,
26
26
  address: 'http://127.0.0.1:3333/browser',
27
27
  methods: ['browser'],
28
28
  },
@@ -1380,7 +1380,7 @@ async function remoteRequest(url, method, options) {
1380
1380
  }
1381
1381
 
1382
1382
  function useRemoteRequest(options, method) {
1383
- if (options.remote.enabled) {
1383
+ if (options.remote.enable) {
1384
1384
  if (options.useRemote) {
1385
1385
  return true;
1386
1386
  }
package/src/server.js CHANGED
@@ -42,7 +42,7 @@ function curateOptions(options) {
42
42
  return {
43
43
  ...options,
44
44
  remote: {
45
- enabled: false,
45
+ enable: false,
46
46
  },
47
47
  useRemote: false,
48
48
  control: options.control
@@ -124,7 +124,12 @@ async function initServer(address, unprint) {
124
124
  });
125
125
  });
126
126
 
127
- app.listen(port, host, () => {
127
+ app.listen(port, host, (error) => {
128
+ if (error) {
129
+ logger.error(`Failed to start server: ${error.message}`);
130
+ return;
131
+ }
132
+
128
133
  logger.info(`Started unprint server on ${host}:${port}`);
129
134
  });
130
135
  }
package/tests/remote.js CHANGED
@@ -4,7 +4,7 @@ const unprint = require('../src/app');
4
4
 
5
5
  unprint.configure({
6
6
  remote: {
7
- enabled: true,
7
+ enable: true,
8
8
  address: 'http://127.0.0.1:3333',
9
9
  key: 'foobar',
10
10
  },