Compare commits

...

1 Commits
master ... v1

Author SHA1 Message Date
GochoMugo ab17ba2848
pkg: Drop support for Node.js v0.12, v4, v5 8 years ago
  1. 3
      .travis.yml
  2. 3
      CHANGELOG.md
  3. 12
      index.js
  4. 2
      package.json
  5. 8
      test/telegram.js

@ -4,9 +4,6 @@ node_js:
- "8"
- "7"
- "6"
- "5"
- "4"
- "0.12"
after_success:
- bash <(curl -s https://codecov.io/bash)
cache:

@ -9,6 +9,9 @@ Added:
* Add support for Node.js v9
Removed:
* Drop support for Node.js v0.12, v4, v5
* * *

@ -1,13 +1 @@
/**
* If running on Nodejs 5.x and below, we load the transpiled code.
* Otherwise, we use the ES6 code.
* We are deprecating support for Node.js v5.x and below.
*/
const majorVersion = parseInt(process.versions.node.split('.')[0], 10);
if (majorVersion <= 5) {
const deprecate = require('depd')('node-telegram-bot-api');
deprecate('Node.js v5.x and below will no longer be supported in the future');
module.exports = require('./lib/telegram');
} else {
module.exports = require('./src/telegram');
}

@ -25,7 +25,7 @@
"author": "Yago Pérez <yagoperezs@gmail.com>",
"license": "MIT",
"engines": {
"node": ">=0.12"
"node": ">=6"
},
"dependencies": {
"array.prototype.findindex": "^2.0.0",

@ -55,15 +55,9 @@ before(function beforeAll() {
describe('module.exports', function moduleExportsSuite() {
const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
it('is loaded from src/ on Node.js v6+ and above', function test() {
if (nodeVersion <= 5) this.skip(); // skip on Node.js v5 and below
it('is loaded from src', function test() {
assert.equal(TelegramBot, require('../src/telegram'));
});
it('is loaded from lib/ on Node.js v5 and below', function test() {
if (nodeVersion > 5) this.skip(); // skip on newer versions
assert.equal(TelegramBot, require('../lib/telegram'));
});
});

Loading…
Cancel
Save