Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Relation rank to find the most important entity of a group based on either properties or proximity.
npm install frostrank
ranker = require('frostrank');
ranker.rank(docs, opts, cb);
var frostrank = require('./index');
var properties = [{ weight: 1, value: 'type' }, { weight: 2, value: 'category' },{ weight: 2.5, value: 'name' }];
var opts = { type: 'weighted', properties: properties, tolerance: 0.00000000001 };
var jobs = [
{ type: 'software', category: 'contract', name : 'Front End Developer' },
{ type: 'business', category: 'par-time', name : 'Business Analyst' },
{ type: 'it', category: 'full-time', name : 'Cloud Infrastructure Designer' },
{ type: 'software', category: 'contract', name : 'Full Stack JavaScript Developer' },
{ type: 'business', category: 'contract', name : 'Project Manager' },
{ type: 'it', category: 'contract', name : 'Linux OS Administrator' },
{ type: 'software', category: 'full-time', name : 'Full Stack JavaScript Developer' },
{ type: 'finance', category: 'full-time', name : 'Accountant' },
{ type: 'hr', category: 'part-time', name : 'Account Representative' },
{ type: 'business', category: 'full-time', name : 'Project Manager' },
{ type: 'software', category: 'contract', name : 'Full Stack Ruby Developer' },
];
var cb = function(jobs, rankings){
console.log('Rankings');
console.log(rankings);
};
frostrank.rank(jobs, opts, cb);
Which outputs
Rankings
[ [ 0.3049765308250947 ],
[ 5.4885092862590825e-12 ],
[ 1.0346044976897382e-11 ],
[ 0.5783652498536891 ],
[ 0.46900976224495505 ],
[ 0.19562104321286128 ],
[ 0.38274420665117387 ],
[ 1.0346044976897377e-11 ],
[ 1.989164731862428e-12 ],
[ 0.2733887190424398 ],
[ 0.3049765308250947 ] ]
In the above example, I am doing a weighted ranking against available jobs at a certain company. I am ranking in respect to the following properties, type, category, and name. In this ranking I am saying the connection between type, is more important than both category and name (1 vs 2 and 2.5). I am also saying category is slightly more important than name (2 vs. 2.5).
The results show that the Full Stack JavaScript Developer position are the post "important". Basically, they are the most used name in the most prominent category, in the most popular type. This is just a simple exampe. Your situation can be as complex as you'd like.
FAQs
Relation Rank
The npm package frostrank receives a total of 2 weekly downloads. As such, frostrank popularity was classified as not popular.
We found that frostrank demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.