language: node_js
node_js:
  - 8
  - 6
  - 4
env:
  - FRESH_DEPS=false
  - FRESH_DEPS=true
matrix:
  exclude:
    - node_js: 6
      env: FRESH_DEPS=true
    - node_js: 4
      env: FRESH_DEPS=true
cache:
  directories:
    - $HOME/.npm
before_install:
  - npm install --global npm@^5.0.3
  - npm --version
  - if [[ ${FRESH_DEPS} == "true" ]]; then rm package-lock.json; fi
install:
  - if [[ ${FRESH_DEPS} == "true" ]]; then npm install --prefer-online; else npm install --prefer-offline; fi
script: npm run coverage
after_success: ./node_modules/.bin/codecov --file=./coverage/lcov.info

language: node_js
node_js:
  - 10
  - 8
  - 6
env:
  - FRESH_DEPS=false
  - FRESH_DEPS=true
matrix:
  exclude:
    - node_js: 8
      env: FRESH_DEPS=true
    - node_js: 6
      env: FRESH_DEPS=true
cache:
  directories:
    - $HOME/.npm
before_install:
  - npm install --global npm@6.4.1
  - npm --version
install: |
  if [[ ${FRESH_DEPS} == "true" ]]; then
    npm install --no-shrinkwrap --prefer-online;
  else
    npm ci;
    checksum=$(md5sum package-lock.json);
    npm install --package-lock-only;
    if ! echo ${checksum} | md5sum --quiet -c -; then
      echo "package-lock.json was modified unexpectedly. Please rebuild it using npm@$(npm -v) and commit the changes.";
      exit 1;
    fi
  fi
script: npm run coverage
after_success: npx codecov --file=./coverage/lcov.info

Update Travis config, test with Node.js 10, drop Node.js 4
Update Travis config, test with Node.js 10, drop Node.js 4
