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 🙏

© 2024 – Pkg Stats / Ryan Hefner

k-text-analyzer

v0.2.1

Published

A simple library that parses a blob of text and compares it to a configuration file for level of risk. uses would include looking for threats or suicidal ideations. This is not fool-proof and is a work in progress.

Downloads

5

Readme

Text Risk Analysis

This module will aid in determining the risk of a post based upon a supplied configuration. Configurations can be customized depending on context. For example, one configuraiton could be used to analyze a risk level for self harm while another configuration could be created to measure if there is a threat to another person.

The text will be passed in and phrases and words will be analyzed to determine a score. The score is not to be compared with other configurations, as the score exists simply to compare to a baseline of 0. In some configurations, a score of 100 would be a definitive warning while in others it would be just a caution. How each application handles the score will depend on the application.

Goal

This module was created for use in a few applications created by KVSS Technologies. After being used in production, the logic was separated and open sourced. It is hoped that the community will improve the algorithms and generate improved configurations to be used.

Installation

The library is written in TypeScript and is distributed in ES5. In a NodeJS project, usage should be as simple as

var analyzer = require("k-text-analyzer");

var a = new analyzer.Analyzer();

var score = a.analyze("YOUR TEXT");

Building

We have attempted to make building and testing be as self-contained as possible. Therefore, the node_modules directory will be heavy as we will make local copies of TypeScript and Mocha available and referenced.

To build, you should clone the repository and then run

npm install

npm run build

This will create a ./build directory with the generated JS files from the ./src directory.

Testing

To test the code, run

npm run test

This will build the project and then use Mocha to test the generated Javascript. The tests can be found in ./src/tests or ./build/tests

Documentation

The code has attempted to be as clear as possible while also having clear comments. We use TypeDoc to generate HTML documentation. At build time, we generate the documentation for you, but you may also generate the documentation by running

npm run doc

This will create a ./documentation directory you may browse with your favorite browser.