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

2ku-bot-message-parser

v1.0.3

Published

a simple NLP tool for chatbots to extract data from user input

Readme

bot-message-parser

a simple tool for chatbots to extract useful data from user input.

operation

Create a new BotMessageParser object.

const BotMessageParser = require("bot-message-parser")

const parser = new BotMessageParser({ 
    debug: false,
    useCompromise: false,
    commandPrefix: "/",
    namesList: [
        "ryan forever",
        "alice springs"
    ]
});

parser.process(text).then(console.log)

.process() is an async function and will produce the following outputs:

.raw: the original text

.text: the original text, flattned to lower case

.clean: text cleaned of any punctuation, flattened to lowercase, and the dictionary mappings applied.

trigger: the parsed trigger (i.e. !bot or !command, etc)

.hasTrigger: true if message contains a trigger

.triggerOnly: true if the message contains just the trigger

.yes: boolean if user says something like "yes", "yeah", "yep", etc

.no: boolean if user says something like "no", "nah", "hell no", etc

.maybe: boolean if user says something like "maybe", "not sure", "possibly", etc

.idk: boolean if user says something like "idk", "i dont know", "no idea". etc

.what: boolean if user says something like "what?", "huh?","i dont understand", etc

arguments: converts the message string into an array that can be useful for getting arguments

names: returns an array of found names, if a namesList is specified in settings

intent: NLP ONLY intent of the message

numEntities: NLP ONLY number of entities found

entities: NLP ONLY an array of entities

sentiment: NLP ONLY sentiment of the message (positive, negative, or neutral)

compromise

in the options, if you set useCompromise to true, you can activate the nlp processing from compromise

this will search for sever useful things in the message, such as hashtags, urls, emails, phoneNumbers, verbs, and nouns

nlp-js

currently, this this uses nlp-js v3.10.0. if you train a model using this module, you can specify a path to it in the options.

output


/*

{
  id: undefined,
  type: undefined,
  timestamp: undefined,
  raw: '/bot hello there? my name is ryan forever.  do you know ALICE SPRINGS?',
  text: 'hello there? my name is ryan forever.  do you know ALICE SPRINGS?',
  clean: 'hello there my name is ryan forever do you know alice springs',
  attachments: undefined,
  command: 'bot',
  commandRaw: '/bot',
  hasCommand: true,
  commandOnly: false,
  botMentioned: undefined,
  yes: undefined,
  no: undefined,
  maybe: undefined,
  idk: undefined,
  what: undefined,
  arguments: [
    'hello',   'there',
    'my',      'name',
    'is',      'ryan',
    'forever', 'do',
    'you',     'know',
    'alice',   'springs'
  ],
  names: [ 'ryan forever', 'alice springs' ],
  hasIntent: undefined,
  intent: undefined,
  numEntities: 0,
  entities: [],
  sentiment: undefined,
  hashtags: [],
  urls: [],
  emails: [],
  phoneNumbers: [],
  verbs: [],
  nouns: []
}

*/