tymly-rankings-plugin
Plugin which handles ranking of data
Last updated 3 years ago by timneedham .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tymly-rankings-plugin 
SYNC missed versions from official npm registry.

tymly-rankings-plugin

JavaScript Style Guide license

Plugin which handles ranking of data

On tymly startup, this plugin searches the loaded blueprints for .json files in ranking directory. These ranking files indicate what factors should contribute to the ranking score and where to find the value to score. The plugin looks at these factors, and finds the corresponding weights in the registry-keys. With these weights, the plugin generates an SQL View statement which forms a table with scores per factor and a total score for each 'source' row.

The plugin also supplies a state-resource so it can be called to refresh a ranking, which will look to the database for up-to-date registry-keys.

See the test blueprint in /test/fixtures for an example of how to do this.

Install

$ npm install tymly-rankings-plugin --save

Testing

Before running the tests, you'll need a test PostgreSQL database available and set a PG_CONNECTION_STRING environment variable to point to it, for example:

PG_CONNECTION_STRING=postgres://postgres:postgres@localhost:5432/my_test_db

Once the environment variables have been set, you can run the tests like this:

$ npm test

License

MIT

Current Tags

  • 0.0.4                                ...           latest (3 years ago)

2 Versions

  • 0.0.4                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (9)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |