Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: types (#1341)" #1344

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage
test/typescript/.idea/*
test/typescript/*.js
test/typescript/*.map
package-lock.json
# VS Code stuff
**/typings/**
**/.vscode/**
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock = false
1,666 changes: 833 additions & 833 deletions README.md

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions benchmarks/bombing.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#! /usr/bin/env node
var mqtt = require('../')
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, keepalive: 0 })
var sent = 0
var interval = 5000
function count () {
console.log('sent/s', sent / interval * 1000)
sent = 0
}
setInterval(count, interval)
function publish () {
sent++
client.publish('test', 'payload', publish)
}
client.on('connect', publish)
client.on('error', function () {
console.log('reconnect!')
client.stream.end()
})
#! /usr/bin/env node

var mqtt = require('../')
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, keepalive: 0 })

var sent = 0
var interval = 5000

function count () {
console.log('sent/s', sent / interval * 1000)
sent = 0
}

setInterval(count, interval)

function publish () {
sent++
client.publish('test', 'payload', publish)
}

client.on('connect', publish)

client.on('error', function () {
console.log('reconnect!')
client.stream.end()
})
44 changes: 22 additions & 22 deletions benchmarks/throughputCounter.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#! /usr/bin/env node
var mqtt = require('../')
var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, encoding: 'binary', keepalive: 0 })
var counter = 0
var interval = 5000
function count () {
console.log('received/s', counter / interval * 1000)
counter = 0
}
setInterval(count, interval)
client.on('connect', function () {
count()
this.subscribe('test')
this.on('message', function () {
counter++
})
})
#! /usr/bin/env node

var mqtt = require('../')

var client = mqtt.connect({ port: 1883, host: 'localhost', clean: true, encoding: 'binary', keepalive: 0 })
var counter = 0
var interval = 5000

function count () {
console.log('received/s', counter / interval * 1000)
counter = 0
}

setInterval(count, interval)

client.on('connect', function () {
count()
this.subscribe('test')
this.on('message', function () {
counter++
})
})
54 changes: 27 additions & 27 deletions bin/mqtt.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#!/usr/bin/env node
'use strict'
/*
* Copyright (c) 2015-2015 MQTT.js contributors.
* Copyright (c) 2011-2014 Adam Rudd.
*
* See LICENSE for more information
*/
var path = require('path')
var commist = require('commist')()
var helpMe = require('help-me')({
dir: path.join(path.dirname(require.main.filename), '/../doc'),
ext: '.txt'
})
commist.register('publish', require('./pub'))
commist.register('subscribe', require('./sub'))
commist.register('version', function () {
console.log('MQTT.js version:', require('./../package.json').version)
})
commist.register('help', helpMe.toStdout)
if (commist.parse(process.argv.slice(2)) !== null) {
console.log('No such command:', process.argv[2], '\n')
helpMe.toStdout()
}
#!/usr/bin/env node
'use strict'

/*
* Copyright (c) 2015-2015 MQTT.js contributors.
* Copyright (c) 2011-2014 Adam Rudd.
*
* See LICENSE for more information
*/
var path = require('path')
var commist = require('commist')()
var helpMe = require('help-me')({
dir: path.join(path.dirname(require.main.filename), '/../doc'),
ext: '.txt'
})

commist.register('publish', require('./pub'))
commist.register('subscribe', require('./sub'))
commist.register('version', function () {
console.log('MQTT.js version:', require('./../package.json').version)
})
commist.register('help', helpMe.toStdout)

if (commist.parse(process.argv.slice(2)) !== null) {
console.log('No such command:', process.argv[2], '\n')
helpMe.toStdout()
}