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

nqm-api-tdx-stats

v1.5.1

Published

nquiringminds Trusted Data Exchange Statistics API interface for nodejs clients

Downloads

3

Readme

nqm-api-tdx-stats NPM version

nquiringminds statistics API interface for nodejs clients (requires mongoDB >= 3.2)

Install

npm install nqm-api-tdx-stats

Test

npm test

Include

nodejs

const TDXApiStats = require("nqm-api-tdx-stats");

meteor

import TDXApiStats from "nqm-api-tdx-stats/client-api"

web page

Copy client-api.js (generated when you npm install) to your js directory then:

<script src="/path/to/client-api.js"></script>

Usage

Include in the appropriate manner as shown above

Passing a shared key:

const config = {
  "commandHost": "https://cmd.nq-m.com",
  "queryHost": "https://q.nq-m.com",
};

const tokenID = "token_id";
const tokenPass = "token_password";
const datasetID = "datasetID";

const api = new TDXApiStats(config);
api.setShareKey(tokenID, tokenPass);

api.getStdSample(datasetID, [], ["field"], 0)
  .then((result) => {
    // result = the result of the computation
  });

Passing an existing token:

const config = {
  "commandHost": "https://cmd.nq-m.com",
  "queryHost": "https://q.nq-m.com",
  "accessToken": "access_token",
};

const datasetID = "datasetID";

const api = new TDXApiStats(config);

api.getStdSample(datasetID, [], ["field"], 0)
  .then((result) => {
    // result = the result of the computation
  });

Properties and Methods

|Properties|Description| |:---|:---| |tdxApi| The nqm-tdx-api object|

|Methods (authentication)|Description| |:---|:---| |setToken|Sets the token for the tdxApi object| |setShareKey|Sets the shared key for the tdxApi object|

|Methods (first-order)|Description| |:---|:---| |getFirstOrder|Returns the first order statistic| |getMin|Returns the minimum for a set of fields| |getMax|Returns the maximum for a set of fields| |getSum|Returns the sum for a set of fields| |getAvg|Returns the average for a set of fields| |getStdPopulation|Returns the standard deviation (population) for a set of fields| |getStdSample|Returns the standard deviation (sample) for a set of fields| |getMed|Returns the median for a set of fields|

|Methods (first-order chunking)|Description| |:---|:---| |getFirstOrderIterator|Returns an iterator object| |getFirstOrderChunk|Returns the first order statistic using the chunking method| |getMinChunk|Returns the minimum for a set of fields using the chunking method| |getMaxChunk|Returns the maximum for a set of fields using the chunking method| |getSumChunk|Returns the sum for a set of fields using the chunking method| |getAvgChunk|Returns the average for a set of fields using the chunking method| |getStdChunk|Returns the standard deviation for a set of fields using the chunking method|

|Methods (second-order)|Description| |:---|:---| |getHistogram|Returns the histogram for a field|

|Methods (second-order chunking)|Description| |:---|:---| |getHistogramChunk|Returns the histogram for a field using the chunking method|

|Methods (first-order indexed)|Description| |:---|:---| |getMinIndexed|Returns the minimum for an indexed field| |getMaxIndexed|Returns the maximum for an indexed field|

|Methods (second-order indexed)|Description| |:---|:---| |getHistogramIndexed|Returns the histogram for an indexed field|