npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

luis-client

v0.1.4

Published

Luis client for Node

Readme

Luis Client

luis-client is a client sdk to call Microsoft Luis API even you are behind a proxy.

Luis Client is now able to :

  • Predict an utterance and return the intents and attached entities
  • Start a training and Get a Training status
  • create / get / rename / delete an intent
  • create / get / rename/ delete a simple entity
  • create / delete an utterance
  • Get all the utterances

Installation

You need superagent to use the Luis Client You need superagent-proxy to use the Luis Client behind a proxy

npm

npm install luis-client
npm install superagent
npm install superagent-proxy

yarn

yarn add luis-client
yarn add superagent
yarn add superagent-proxy

Getting Started

You have to create a Luis Application following Microsoft Documentation.

Once your application created you will use the Luis Client as http.js

const superagent = require('superagent');
require('superagent-proxy')(superagent)
const agent = superagent.agent();

// set proxy on each request
agent.use((req) => {
    if (process.env.HTTP_PROXY) {
        req.proxy(process.env.HTTP_PROXY);
    }
    return req;
});


module.exports = agent ;

luis.js

const LUISClient = require('luis-client').default;
const agent = require('./http');

const client = new LUISClient({
    appId: '<your application id>',
    appKey: '<your application key>',
    authoringKey: '<your authoring key here>',
    verbose: '<true / false>',
    region: '<your region here>',
    version: '<the luis version>',
    versionId: '<your luis app version>'
}, agent);

Luis Client parameters

  • appId : You will find your application ID in your Luis Application Settings
  • appKey : You will find your application key on the Publish section under Resources and Keys following your region
  • authoringKey : You will find your authoring key in your Luis user settings
  • verbose : Check if you need the verbose return from Luis api
  • region : eastasia, southeastasia, australiaeast, northeurope, westeurope, eastus, eastus2, southcentralus, westcentralus, westus, westus2, brazilsouth. Following Microsoft Luis Refenrence Regions
  • version : Current Luis version 2.0
  • versionId : You will find your published version on the Publish section of your Luis application

Luis existing API calls

Always return a Promise with custom content following the LUIS Cognitive Service API

/********** PREDICT **************/
await client.predict(text);

/********** TRAIN **************/
await client.startTraining();
await client.getTrainingStatus();

/********** INTENTS *************/
await client.createIntent(intentName);
await client.getIntent(intentId);
await client.getIntents();
await client.renameIntent(intentId, intentName);
await client.deleteIntent(intentId);

/********** UTTERANCES/EXAMPLES/LABELS *************/
await client.createUtterance(parameters);
await client.createUtterances(parameters);
await client.deleteUtterance(utteranceId);
await client.getUtterances(skip, take);

/********** ENTITIES *************/
await client.createEntity(entityName);
await client.getEntity(entityId);
await client.getEntities();
await client.renameEntity(entityId, entityName);
await client.deleteEntity(entityId);

Remarks

if you need to add an utterance to your Luis application, you have to be compliant with this json schema.

{
    "type": "object",
    "properties": {
        "text": {
            "type": "string"
        },
        "intentName": {
            "type": "string"
        },
        "entityLabels": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "entityName": {
                        "type": "string"
                    },
                    "startCharIndex": {
                        "type": "integer"
                    },
                    "endCharIndex": {
                        "type": "integer"
                    }
                },
                "required": [
                    "entityName",
                    "startCharIndex",
                    "endCharIndex"
                ]
            }
        }
    }
}

if you need to add several utterances to your Luis application, you have to be compliant with this json schema.

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "text": {
                "type": "string"
            },
            "intentName": {
                "type": "string"
            },
            "entityLabels": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "entityName": {
                            "type": "string"
                        },
                        "startCharIndex": {
                            "type": "integer"
                        },
                        "endCharIndex": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "entityName",
                        "startCharIndex",
                        "endCharIndex"
                    ]
                }
            }
        },
        "required": [
            "text",
            "intentName",
            "entityLabels"
        ]
    }
}

Sample

If you need more examples, please visits the luis-connect repository