fritz-callmonitor
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
private readonly port; | ||
private readonly _socket; | ||
private readonly socket; | ||
constructor(host: string, port?: number); | ||
@@ -9,0 +9,0 @@ connect(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const byline_1 = require("byline"); | ||
const net_1 = require("net"); | ||
const events_1 = require("events"); | ||
const readline_1 = require("readline"); | ||
const datePattern = /(\d+?)\.(\d+?)\.(\d+?)\s+?(\d+?):(\d+?):(\d+?)/gi; | ||
@@ -12,10 +12,12 @@ class CallMonitor extends events_1.EventEmitter { | ||
this.port = port; | ||
this._socket = new net_1.Socket(); | ||
this.socket = new net_1.Socket(); | ||
} | ||
connect() { | ||
const s = this._socket; | ||
const s = this.socket; | ||
s.on("connect", () => { | ||
const reader = byline_1.createStream(this._socket, { encoding: "utf-8" }); | ||
reader.on("data", (l) => this.processLine(l)); | ||
s.once("end", () => reader.end()); | ||
const reader = readline_1.createInterface({ | ||
input: this.socket, | ||
}); | ||
reader.on("line", l => this.processLine(l)); | ||
s.once("close", () => reader.close()); | ||
this.emit("connect"); | ||
@@ -30,3 +32,3 @@ }); | ||
end() { | ||
this._socket.end(); | ||
this.socket.end(); | ||
} | ||
@@ -33,0 +35,0 @@ processLine(line) { |
{ | ||
"name": "fritz-callmonitor", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "Provides a TypeScript Node.js wrapper for the call monitor api of the AVM Fritz!Box.", | ||
@@ -15,9 +15,7 @@ "main": "lib/index.js", | ||
}, | ||
"dependencies": { | ||
"byline": "^5.0.0" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/byline": "^4.2.31", | ||
"@types/node": "^11.13.6", | ||
"rimraf": "^2.6.3", | ||
"typescript": "^3.3.3333" | ||
"typescript": "^3.4.4" | ||
}, | ||
@@ -24,0 +22,0 @@ "scripts": { |
@@ -1,4 +0,5 @@ | ||
# fritz-callmonitor [![Build Status](https://travis-ci.com/nikeee/fritz-callmonitor.svg?branch=master)](https://travis-ci.com/nikeee/fritz-callmonitor) | ||
Provides a node.js wrapper for the call monitor api of the AVM Fritz!Box. Written in TypeScript. | ||
# fritz-callmonitor [![Build Status](https://travis-ci.com/nikeee/fritz-callmonitor.svg?branch=master)](https://travis-ci.com/nikeee/fritz-callmonitor) [![npm version](https://badge.fury.io/js/fritz-callmonitor.svg)](https://www.npmjs.com/package/fritz-callmonitor) ![Dependency Status](https://david-dm.org/nikeee/fritz-callmonitor.svg) ![License](https://img.shields.io/npm/l/fritz-callmonitor.svg) | ||
Provides a Node.js wrapper for the call monitor api of the AVM Fritz!Box. Written in TypeScript. | ||
## Installation | ||
@@ -5,0 +6,0 @@ ```Shell |
15756
0
163
50
- Removedbyline@^5.0.0
- Removedbyline@5.0.0(transitive)