micha149 / homelib

5 stars 1 forks source link

Question: When an npm package will be available? #1

Open damianog opened 11 years ago

damianog commented 11 years ago

Hi @micha149

I am interested in your homelib library, I am developing a web interface with Raspberry Pi to comunicate with an existing KNX router and i have some question:

Will an NPM package be available?

or

Can I actually download to do some test and run without particular errors?

Thanks!

micha149 commented 11 years ago

Hi @damianog!

Thank you for your interest. Yes, a npm package will be available with release 0.1.0. But currently only listening to messages works. And only for 60 seconds. Sending and heartbeat will be implemented soon. This should satisfy your requirements.

You may try this few lines to checkout the KnxIP driver without the connection object:

var homelib = require('./homelib'),
    caterpillar = require('caterpillar');

var driver = new homelib.Driver.KnxIpDriver({
    logger: new homelib.Log.ConsoleAdapter(),
    localPort: 51234,
    localAddress: "192.168.2.13",
    remotePort: 3671,
    remoteAddress: "192.168.2.23"
});

driver.on('packet', function(packet) {
    console.info('packet received', packet);
});

driver.on('message', function(msg) {
    console.info(msg);
});

driver.on('connected', function() {
    console.info('connected to IP interface');
})

driver.connect();
damianog commented 10 years ago

Hi, me again!

I forgot to thanked you for your suggestion and I wanted to do it now.

I would like to ask you also what you think of using Typescript to generate the code of your library. I thought I could write the definition files but perhaps a complex project like yours could be written directly in Typescript with many other advantages.

micha149 commented 10 years ago

Hi. I want to give developers an easy entry to this library. So it is not so good to build on any superset languages like TypeScript or languages like CoffeeScript, which gets compiled into Javascript. Nevertheless, I would welcome the typescript definition files, which developers can use to build TypeScript projects upon this library.

By the way: The 0.1.0 release comes very close :wink: