Skip to content

Commit e6672e8

Browse files
author
Yoseph Maguire
authored
Revert "fix: types (mqttjs#1341)" (mqttjs#1344)
This reverts commit 59fab36.
1 parent 59fab36 commit e6672e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10714
-10712
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ coverage
1515
test/typescript/.idea/*
1616
test/typescript/*.js
1717
test/typescript/*.map
18+
package-lock.json
1819
# VS Code stuff
1920
**/typings/**
2021
**/.vscode/**

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock = false

README.md

Lines changed: 833 additions & 833 deletions
Large diffs are not rendered by default.

benchmarks/bombing.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
#! /usr/bin/env node
2-
3-
var mqtt = require('../')
4-
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, keepalive: 0 })
5-
6-
var sent = 0
7-
var interval = 5000
8-
9-
function count () {
10-
console.log('sent/s', sent / interval * 1000)
11-
sent = 0
12-
}
13-
14-
setInterval(count, interval)
15-
16-
function publish () {
17-
sent++
18-
client.publish('test', 'payload', publish)
19-
}
20-
21-
client.on('connect', publish)
22-
23-
client.on('error', function () {
24-
console.log('reconnect!')
25-
client.stream.end()
26-
})
1+
#! /usr/bin/env node
2+
3+
var mqtt = require('../')
4+
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, keepalive: 0 })
5+
6+
var sent = 0
7+
var interval = 5000
8+
9+
function count () {
10+
console.log('sent/s', sent / interval * 1000)
11+
sent = 0
12+
}
13+
14+
setInterval(count, interval)
15+
16+
function publish () {
17+
sent++
18+
client.publish('test', 'payload', publish)
19+
}
20+
21+
client.on('connect', publish)
22+
23+
client.on('error', function () {
24+
console.log('reconnect!')
25+
client.stream.end()
26+
})

benchmarks/throughputCounter.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
#! /usr/bin/env node
2-
3-
var mqtt = require('../')
4-
5-
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, encoding: 'binary', keepalive: 0 })
6-
var counter = 0
7-
var interval = 5000
8-
9-
function count () {
10-
console.log('received/s', counter / interval * 1000)
11-
counter = 0
12-
}
13-
14-
setInterval(count, interval)
15-
16-
client.on('connect', function () {
17-
count()
18-
this.subscribe('test')
19-
this.on('message', function () {
20-
counter++
21-
})
22-
})
1+
#! /usr/bin/env node
2+
3+
var mqtt = require('../')
4+
5+
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, encoding: 'binary', keepalive: 0 })
6+
var counter = 0
7+
var interval = 5000
8+
9+
function count () {
10+
console.log('received/s', counter / interval * 1000)
11+
counter = 0
12+
}
13+
14+
setInterval(count, interval)
15+
16+
client.on('connect', function () {
17+
count()
18+
this.subscribe('test')
19+
this.on('message', function () {
20+
counter++
21+
})
22+
})

bin/mqtt.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
#!/usr/bin/env node
2-
'use strict'
3-
4-
/*
5-
* Copyright (c) 2015-2015 MQTT.js contributors.
6-
* Copyright (c) 2011-2014 Adam Rudd.
7-
*
8-
* See LICENSE for more information
9-
*/
10-
var path = require('path')
11-
var commist = require('commist')()
12-
var helpMe = require('help-me')({
13-
dir: path.join(path.dirname(require.main.filename), '/../doc'),
14-
ext: '.txt'
15-
})
16-
17-
commist.register('publish', require('./pub'))
18-
commist.register('subscribe', require('./sub'))
19-
commist.register('version', function () {
20-
console.log('MQTT.js version:', require('./../package.json').version)
21-
})
22-
commist.register('help', helpMe.toStdout)
23-
24-
if (commist.parse(process.argv.slice(2)) !== null) {
25-
console.log('No such command:', process.argv[2], '\n')
26-
helpMe.toStdout()
27-
}
1+
#!/usr/bin/env node
2+
'use strict'
3+
4+
/*
5+
* Copyright (c) 2015-2015 MQTT.js contributors.
6+
* Copyright (c) 2011-2014 Adam Rudd.
7+
*
8+
* See LICENSE for more information
9+
*/
10+
var path = require('path')
11+
var commist = require('commist')()
12+
var helpMe = require('help-me')({
13+
dir: path.join(path.dirname(require.main.filename), '/../doc'),
14+
ext: '.txt'
15+
})
16+
17+
commist.register('publish', require('./pub'))
18+
commist.register('subscribe', require('./sub'))
19+
commist.register('version', function () {
20+
console.log('MQTT.js version:', require('./../package.json').version)
21+
})
22+
commist.register('help', helpMe.toStdout)
23+
24+
if (commist.parse(process.argv.slice(2)) !== null) {
25+
console.log('No such command:', process.argv[2], '\n')
26+
helpMe.toStdout()
27+
}

0 commit comments

Comments
 (0)