2.1.0 • Published 7 years ago

relu-core v2.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

#relu-core

relu-core is module that can be used as a core of a bot. It has functions that simplify http/https/request calls, access json files to retrieve informations or modify/add/delete nodes, create variable herocards and setup LUIS entities.

#installation

npm install relu-core

#functions

----ReluConfig.JsonReader(session, data, leaf, parent);

This function walk through a json (stored in "data") until it finds the specified node(leaf). When the function finds the leaf, it returns the content. The parent parameter is optional. It is used to specify which leaf node you are specifically search if there are more than one leaf with the same name. Obviusly the leaf node you want must be inside the parent node, if parent is specified.

----ReluConfig.AddJsonNode(session, json, filename, node, object, text, parent);

This function does the same as the JsonReader, but when you find the specific node, it adds into the node, another node, called "object"(you pass the name), and assign "text" as his content(you also pass text). The content can be a simple string, an object or an array. You can also modify the content of node; when you find the node, you assign the "text" to the specific node, and the function overwrite the content of the node. This function use fs module to access the json file specified with "filename". The function of "parent" parameter is the same as previous.

----ReluConfig.DeleteJsonNode(session, json, filename, node, parent);

Works in the same way of AddJsonNode, but delete the specified node.

----ReluCards.CreateCards(session, nCards, title, text, nButtons, linkImages, buttonReturn, nameButton);

This function Creates a variable number of Herocards with variable name, text, buttons, image, title, buttonReturn and buttonNames.

----ReluEntity.EntitySetup(nEntities, arrayEntities, arrayBuilt, session, args);

This functions find entities and them specific builtin/intent in the variables in arrayEntities.

----ReluRest.HttpRequest(host, path); / ReluRest.HttpsRequest(link); / ReluRest.Request(linkObject, method, linkAPI, key);

These functions are used to simplify the http/https/request calls. You only have to write one line of code and with the arguments these functions do for you the specific calls and return the parsed JSON with all the information you want. After, you only have to access the JSON to retrieve the info.

2.1.0

7 years ago

2.0.0

7 years ago

0.9.0

7 years ago

1.0.0

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago