You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

kifli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kifli - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+10
.travis.yml
language: node_js
node_js:
- "node"
after_success:
- "./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls"
notifications:
email: false
+13
-9

@@ -6,21 +6,25 @@ #! /usr/bin/env node

args
.option('broker', 'MQTT Broker address', 'mqtt://localhost:1883')
.option('topic', 'MQTT topic with auto-subscription');
const params = args.parse(process.argv);
const file = args.sub[0];
const kifli = require(join('..', main));
const start = async (broker, topic, config, listener) => {
const client = await kifli(broker, config);
const topic$ = await client.subscribe(topic);
topic$.onValue(listener(client));
topic$
.skipDuplicates((a, b) => JSON.stringify(a) === JSON.stringify(b))
.onValue(listener(client));
};
args
.option('broker', 'MQTT Broker address', 'http://localhost:1883')
.option('topic', 'MQTT topic to auto-subscription');
const clientId = [`${name}`, `${parse(file).name}`, `${process.pid}`].join('/');
const params = args.parse(process.argv);
const file = args.sub[0];
const kifli = require(join('..', main));
start(
params['broker'],
params['topic'],
{ clientId: [`${name}`, `${parse(file).name}`, `${process.pid}`].join('/') },
{ clientId },
require(resolve(process.cwd(), file))
);

@@ -44,3 +44,3 @@ const { test } = require('ava');

const client = await sut('mqtt://fake.url', { clientId: 'test' });
t.notThrows(client.publish('/test', 'foobar'));
t.notThrows(async () => await client.publish('/test', 'foobar'));
});

@@ -50,3 +50,3 @@

const client = await sut('mqtt://fake.url', { clientId: 'test' });
t.notThrows(client.end());
t.notThrows(async () => await client.end());
});
{
"name": "kifli",
"version": "1.0.0",
"version": "1.1.0",
"description": "nanoservice for mqtt protocol (nano+mqtt=kifli)",

@@ -11,5 +11,4 @@ "main": "lib/index.js",

"scripts": {
"test": "ava -v -T 3000",
"cov": "nyc ava",
"report": "nyc --reporter=lcov ava"
"test": "nyc ava -v",
"report": "nyc report --reporter=lcov"
},

@@ -23,11 +22,12 @@ "keywords": [

"dependencies": {
"args": "^2.3.0",
"debug": "^2.6.1",
"kefir": "^3.7.1",
"mqtt": "^2.4.0"
"args": "^3.0.8",
"debug": "^3.1.0",
"kefir": "^3.8.1",
"mqtt": "^2.15.0"
},
"devDependencies": {
"ava": "^0.18.2",
"mock-require": "^2.0.1",
"nyc": "^10.1.2"
"ava": "^0.24.0",
"coveralls": "^3.0.0",
"mock-require": "^2.0.2",
"nyc": "^11.4.1"
},

@@ -34,0 +34,0 @@ "directories": {

# kifli
[![Build Status](https://travis-ci.org/balazs4/kifli.svg?branch=master)](https://travis-ci.org/balazs4/kifli)
[![Coverage Status](https://coveralls.io/repos/github/balazs4/kifli/badge.svg?branch=master)](https://coveralls.io/github/balazs4/kifli?branch=master)
[![npm version](https://badge.fury.io/js/kifli.svg)](https://badge.fury.io/js/kifli)
[![dependencies Status](https://david-dm.org/balazs4/kifli/status.svg)](https://david-dm.org/balazs4/kifli)
[![devDependencies Status](https://david-dm.org/balazs4/kifli/dev-status.svg)](https://david-dm.org/balazs4/kifli?type=dev)
> nano library to handle messages sent throught MQTT protocol. It wraps the [mqtt.js](https://github.com/mqttjs/MQTT.js) module

@@ -15,3 +21,3 @@

+ ``yarn add kifli``
+ ``npm install --save kifli``
+ add the following script to your ``package.json``

@@ -22,3 +28,3 @@

"scripts": {
"start": "kifli handler.js --broker http://localhost:1883 --topic '/sum' "
"start": "kifli handler.js --broker mqtt://localhost:1883 --topic '/sum' "
}

@@ -43,8 +49,1 @@ }

````
## TODO
+ [ ] mqtt config object
+ [ ] API description
+ [ ] more example

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display