2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 18:07:16 +00:00

pkg: Drop support for Node.js v0.12, v4, v5

This commit is contained in:
GochoMugo 2017-11-16 21:18:08 +03:00
parent 9cf36a3b20
commit ab17ba2848
No known key found for this signature in database
GPG Key ID: 7B6A01CB57AA39E4
5 changed files with 6 additions and 24 deletions

View File

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

View File

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

View File

@ -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');
}

View File

@ -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",

View File

@ -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'));
});
});