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

extatistic

v1.3.7

Published

Perform statistical models on any text and extract specific features

Downloads

9

Readme

extatistic

Test Publish NPM version

Perform (statistical) methods on TEXT. Extract user defined features. Contains predefined helper functions. Analyse any source string (code, statement, quote, html, xml, json, etc).

Github repository: npm/extatistic | npm package: npm/extatistic

This project is part of the Guardjs, that used to extract features of normal javascript source code.
It has the capability to easily reduce or increase a feature model to the feature set through cli or api.

CLI

npx extatistic create --name lengthOfstr.js
To create a new feature named lengthOfstr.js. It can provided as a path.

npx extatistic list
To get the list of all registered features. If any error be in features there should be shown.

npx extatistic list > res.csv

npx extatistic execute
To start executing all features (methods in folder called 'features') on source text (of files in folder called 'input'). Results willl be saved as a csv file in a folder called 'ouput'.

npx extatistic execute >> res.csv

API

There's a sample code to show how to use the code and how it works:

const {
    registerAFeature,       // register a feature in to feature list
    registerFeaturesList,   // register a list of features to feature list
    getListOfFeaturesName,  // return a list of all registered features
    getNumberOfFeatures,    // return total number of registerd features
    extractfeaturesRaw,     // calculate and return a raw of features value
} = require('extatistic')

const newFeature = sourceString => sourceString.length || 0
registerAFeature(newFeature)

console.log(getListOfFeaturesName())                // newFeature
console.log(getNumberOfFeatures())                  // 1
console.log(extractfeaturesRaw('a sample string'))  // 15

const anotherFeature = sourceString => (sourceString.length / 2) || 0
registerAFeature(anotherFeature)

console.log(getListOfFeaturesName())                // newFeature, anotherFeature
console.log(getNumberOfFeatures())                  // 2
console.log(extractfeaturesRaw('a sample string'))  // 15, 7.5

The API:

| function | params | returns | description | |:----------------------|:-----------|:------------|:---------------------------------------------| | getListOfFeaturesName | | string | return a list of all registered features | | getNumberOfFeatures | | number | return total number of registerd features | | extractfeaturesRaw | string | string | calculate and return a raw of features value | | registerAFeature | function | undefined | register a feature in to feature list | | registerFeaturesList | object | undefined | register a list of features to feature list |

every feature added should return a primitive value, it's important!

Anatomy of project

There's Babel used to build this package, Jest used for test, yargs for command line application and fs uesd for manage files.

Contribution

How to help with develop

  1. Fork
  2. Make a change
  3. Request a merge!
  4. And for maintaining this project, if anyone are available and intrested please contact me to be a maintainer!

Contact us

Don't hesitate to contact me about this project
me on github
me on telegram