2.0.0 • Published 5 years ago

sparklite v2.0.0

Weekly downloads
6
License
ISC
Repository
github
Last release
5 years ago

Synopsis

The purpose of this NPM is to provide a light weight API layer for rapid prototyping of Cisco Spark bots.

Motivation

This projects abstracts and reduces the communication with Cisco Spark services into consuming simple JS API that we, developers, understand better. Ultimately what a developer wants to focus is in the business logic, which is the fun part.

Code Example

var port = process.env.PORT || 80;
var sparklite = require("sparklite");
var botdomain = 'MY_BOT_DOMAIN.net'; // i.e “dolores.cisco.net”
var sparkBot = new sparklite.SparkBot(My_Spark_Token, port, botdomain);

sparkBot.printHelloWorld();
 //before version 2.0.0
sparkBot.on('message', function (event)
{
    console.log('Incoming message: '+ JSON.stringify(event.message) + ' from: '+event.person.displayName );
    var sentMessage = 'Hola ' + event.person.displayName;

    sparkBot.sendMessage(event.roomId, sentMessage , function(){
      console.log('Message sent from Bot!');
    });
 })

 //after version 2.0.0
 sparkBot.sparkBotEmitter.on('message', function(event) {
   console.log('Incoming message: '+ JSON.stringify(event.message) + ' from: '+event.person.displayName );
   var sentMessage = 'Hola ' + event.person.displayName;

   sparkBot.sendMessage(event.roomId, sentMessage , function(){
     console.log('Message sent from Bot!');
   });
})

Tests

The tests are implemented with mocha, to execute them run the following command:

npm test

2.0.0

5 years ago

1.0.55

6 years ago

1.0.54

7 years ago

1.0.53

7 years ago

1.0.52

7 years ago

1.0.51

7 years ago

1.0.50

7 years ago

1.0.49

7 years ago

1.0.48

7 years ago

1.0.47

7 years ago

1.0.46

7 years ago

1.0.45

7 years ago

1.0.44

7 years ago

1.0.42

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.38

7 years ago

1.0.37

7 years ago

1.0.36

7 years ago

1.0.35

7 years ago

1.0.34

7 years ago

1.0.33

7 years ago

1.0.32

7 years ago

1.0.31

7 years ago

1.0.30

7 years ago

1.0.29

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago