Skip to content

Commit ab17ba2

Browse files
committed
pkg: Drop support for Node.js v0.12, v4, v5
1 parent 9cf36a3 commit ab17ba2

File tree

5 files changed

+6
-24
lines changed

5 files changed

+6
-24
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ node_js:
44
- "8"
55
- "7"
66
- "6"
7-
- "5"
8-
- "4"
9-
- "0.12"
107
after_success:
118
- bash <(curl -s https://codecov.io/bash)
129
cache:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Added:
99

1010
* Add support for Node.js v9
1111

12+
Removed:
13+
14+
* Drop support for Node.js v0.12, v4, v5
1215

1316

1417
* * *

index.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
/**
2-
* If running on Nodejs 5.x and below, we load the transpiled code.
3-
* Otherwise, we use the ES6 code.
4-
* We are deprecating support for Node.js v5.x and below.
5-
*/
6-
const majorVersion = parseInt(process.versions.node.split('.')[0], 10);
7-
if (majorVersion <= 5) {
8-
const deprecate = require('depd')('node-telegram-bot-api');
9-
deprecate('Node.js v5.x and below will no longer be supported in the future');
10-
module.exports = require('./lib/telegram');
11-
} else {
12-
module.exports = require('./src/telegram');
13-
}
1+
module.exports = require('./src/telegram');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"author": "Yago Pérez <yagoperezs@gmail.com>",
2626
"license": "MIT",
2727
"engines": {
28-
"node": ">=0.12"
28+
"node": ">=6"
2929
},
3030
"dependencies": {
3131
"array.prototype.findindex": "^2.0.0",

test/telegram.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,9 @@ before(function beforeAll() {
5555

5656

5757
describe('module.exports', function moduleExportsSuite() {
58-
const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
59-
it('is loaded from src/ on Node.js v6+ and above', function test() {
60-
if (nodeVersion <= 5) this.skip(); // skip on Node.js v5 and below
58+
it('is loaded from src', function test() {
6159
assert.equal(TelegramBot, require('../src/telegram'));
6260
});
63-
it('is loaded from lib/ on Node.js v5 and below', function test() {
64-
if (nodeVersion > 5) this.skip(); // skip on newer versions
65-
assert.equal(TelegramBot, require('../lib/telegram'));
66-
});
6761
});
6862

6963

0 commit comments

Comments
 (0)