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

ahpjs

v1.0.23

Published

The Analytic Hierarchy Process (AHP) is a method for organizing and analyzing complex decisions, using math and psychology. It was developed by Thomas L. Saaty in the 1970s and has been refined since then. It contains three parts: the ultimate goal or pro

Downloads

17

Readme

ahpjs

The Analytic Hierarchy Process (AHP) is a method for organizing and analyzing complex decisions, using math and psychology. It was developed by Thomas L. Saaty in the 1970s and has been refined since then. It contains three parts: the ultimate goal or problem you’re trying to solve, all of the possible solutions, called alternatives, and the criteria you will judge the alternatives on. AHP provides a rational framework for a needed decision by quantifying its criteria and alternative options, and for relating those elements to the overall goal.

Stakeholders compare the importance of criteria, two at a time, through pair-wise comparisons. Example, do you care about job benefits or having a short commute more, and by how much more? AHP converts these evaluations into numbers, which can be compared to all of the possible criteria. This quantifying capability distinguishes the AHP from other decision making techniques.

In the final step of the process, numerical priorities are calculated for each of the alternative options. These numbers represent the most desired solutions, based on all users’ values.

Use of libraries:

1. Dependency installation

npm i ahpjs

2. importing the library

import getHierarchyAnalysisResult from "ahpjs"

3. Calling the function

const result = getHierarchyAnalysisResult({ items, params, weights, }); // output: [0.5, 0.3, 0.2]

Example:

const items = [ { 'adv_post_reach_12h': 45866, 'adv_post_reach_24h': 58456, 'adv_post_reach_48h': 70164, 'avg_post_reach': 214008, 'ci_index': 1067.48, 'daily_reach': 363693, 'err_percent': 64.1, 'forwards_count': 8666, 'id': 321, 'mentioning_channels_count': 4807, 'mentions_count': 9275, 'participants_count': 334073, }, { 'adv_post_reach_12h': 466242, 'adv_post_reach_24h': 566097, 'adv_post_reach_48h': 732951, 'avg_post_reach': 1833126, 'ci_index': 4327.92, 'daily_reach': 1165193, 'err_percent': 171.7, 'forwards_count': 41088, 'id': 11031599, 'mentioning_channels_count': 8832, 'mentions_count': 30002, 'participants_count': 1067476, }, { 'adv_post_reach_12h': 368692, 'adv_post_reach_24h': 464078, 'adv_post_reach_48h': 524071, 'avg_post_reach': 606667, 'ci_index': 1153.42, 'daily_reach': 5759403, 'err_percent': 54.7, 'forwards_count': 22049, 'id': 249927, 'mentioning_channels_count': 3241, 'mentions_count': 23141, 'participants_count': 1109125, }, ];

const params = ['avg_post_reach', 'ci_index', 'daily_reach', 'adv_post_reach_12h'];

const weights = [ [1, 2, 4, 5], [1 / 2, 1, 2, 4], [1 / 4, 1 / 2, 1, 2], [1 / 5, 1 / 4, 1 / 2, 1], ];

const result = getHierarchyAnalysisResult({ items: channels, params: params, weights: weights, }); // output: [0.076, 0.564, 0.361]