Browse Source

drop support for node < v10

Upgrade deps
master
Lloyd Brookes 4 years ago
parent
commit
c697416c80
  1. 2
      .travis.yml
  2. 2
      LICENSE
  3. 2
      README.md
  4. 4
      bin/cli.js
  5. 1961
      package-lock.json
  6. 44
      package.json
  7. 4
      test/api.js
  8. 8
      test/cli.js

2
.travis.yml

@ -1,5 +1,5 @@
language: node_js
node_js:
- 8
- 10
- 12
- 13

2
LICENSE

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2013-19
Copyright (c) 2013-20
Lloyd Brookes <75pound@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy

2
README.md

@ -120,4 +120,4 @@ $ npm install -g local-web-server
* * *
&copy; 2013-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
&copy; 2013-20 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

4
bin/cli.js

@ -1,10 +1,10 @@
#!/usr/bin/env node
const nodeVersionMatches = require('node-version-matches')
if (nodeVersionMatches('>=8')) {
if (nodeVersionMatches('>=10')) {
const WsCli = require('../lib/cli-app')
const cli = new WsCli()
cli.start()
} else {
console.log('Sorry, this app requires node v8.0.0 or above. Please upgrade https://nodejs.org/en/')
console.log('Sorry, this app requires node v10.0.0 or above. Please upgrade https://nodejs.org/en/')
}

1961
package-lock.json
File diff suppressed because it is too large
View File

44
package.json

@ -27,7 +27,7 @@
"full-stack"
],
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "test-runner test/*.js",
@ -39,29 +39,29 @@
"index.js"
],
"dependencies": {
"lws": "^2.0.7",
"lws-basic-auth": "^1.0.3",
"lws-blacklist": "^2.0.2",
"lws-body-parser": "^1.0.2",
"lws-compress": "^1.0.2",
"lws-conditional-get": "^1.0.1",
"lws-cors": "^2.0.1",
"lws-index": "^1.0.5",
"lws-json": "^1.0.1",
"lws-log": "^1.0.3",
"lws-mime": "^1.0.1",
"lws-range": "^2.0.1",
"lws-request-monitor": "^1.0.4",
"lws-rewrite": "^2.0.10",
"lws-spa": "^2.0.2",
"lws-static": "^1.1.3",
"node-version-matches": "^1.0.1"
"lws": "^3.0.0",
"lws-basic-auth": "^2.0.0",
"lws-blacklist": "^3.0.0",
"lws-body-parser": "^2.0.0",
"lws-compress": "^2.0.0",
"lws-conditional-get": "^2.0.0",
"lws-cors": "^3.0.0",
"lws-index": "^2.0.0",
"lws-json": "^2.0.0",
"lws-log": "^2.0.0",
"lws-mime": "^2.0.0",
"lws-range": "^3.0.0",
"lws-request-monitor": "^2.0.0",
"lws-rewrite": "^3.0.0",
"lws-spa": "^3.0.0",
"lws-static": "^2.0.0",
"node-version-matches": "^2.0.1"
},
"devDependencies": {
"coveralls": "^3.0.7",
"jsdoc-to-markdown": "^5.0.2",
"coveralls": "^3.0.9",
"jsdoc-to-markdown": "^5.0.3",
"node-fetch": "^2.6.0",
"nyc": "^14.1.1",
"test-runner": "^0.7.2"
"nyc": "^15.0.0",
"test-runner": "^0.8.13"
}
}

4
test/api.js

@ -1,7 +1,7 @@
const Tom = require('test-runner').Tom
const fetch = require('node-fetch')
const LocalWebServer = require('../')
const a = require('assert')
const a = require('assert').strict
const tom = module.exports = new Tom()
@ -14,5 +14,5 @@ tom.test('basic', async function () {
const response = await fetch(`http://localhost:${port}/one.txt`)
ws.server.close()
const body = await response.text()
a.strictEqual(body, 'one\n')
a.equal(body, 'one\n')
})

8
test/cli.js

@ -1,5 +1,5 @@
const Tom = require('test-runner').Tom
const a = require('assert')
const a = require('assert').strict
const WsCli = require('../lib/cli-app')
const fetch = require('node-fetch')
@ -11,7 +11,7 @@ tom.test('simple', async function () {
const server = cli.start([ '--port', `${port}` ])
const response = await fetch(`http://127.0.0.1:${port}/package.json`)
server.close()
a.strictEqual(response.status, 200)
a.equal(response.status, 200)
})
tom.test('bad option', async function () {
@ -19,7 +19,7 @@ tom.test('bad option', async function () {
const cli = new WsCli({ logError: function () {} })
const server = cli.start([ '--should-fail' ])
if (!exitCode) process.exitCode = 0
a.strictEqual(server, undefined)
a.equal(server, undefined)
})
tom.test('--help', async function () {
@ -32,7 +32,7 @@ tom.test('--version', async function () {
const cli = new WsCli({ log: function (msg) { logMsg = msg } })
cli.start([ '--version' ])
const pkg = require('../package.json')
a.strictEqual(logMsg.trim(), pkg.version)
a.equal(logMsg.trim(), pkg.version)
})
tom.test('default-stack', async function () {

Loading…
Cancel
Save