Giter VIP home page Giter VIP logo

stream-statistics's Introduction

Simple Statistics

A JavaScript implementation of descriptive, regression, and inference statistics.

Coverage Status npm version

Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in node.js.

Installation

  • I'm using Node.js, Webpack, Browserify, Rollup, or another module bundler, and install packages from npm.
    • First, install the simple-statistics module, using npm install simple-statistics, then include the code with require or import:
    • I use the require function to use modules in my project. (most likely)
      • When you use require, you have the freedom to assign the module to any variable name you want, but you need to specify the module's name exactly: in this case, 'simple-statistics'. The require method returns an object with all of the module's methods attached to it.
        var ss = require('simple-statistics')
    • I use import to use modules in my project. I'm probably using Babel, @std/esm, Webpack, or Rollup.
      • Import all functions under the ss object:
        import * as ss from 'simple-statistics'
        Include a specific named export:
        import {min} from 'simple-statistics'
        Simple statistics has only named exports for ES6.
  • I'm using Deno.
  • I'm not using a module bundler. I'm writing a web page, and want to include simple-statistics using a script tag.
    • I want to support all browsers
      • When you use simple-statistics from a script tag, you don't get to choose the variable name it is assigned to: simple-statistics will always become available globally as the variable ss. You can reassign this variable to another name if you want to, but doing so is optional.
        <script src='https://unpkg.com/[email protected]/dist/simple-statistics.min.js'>
        </script>
    • I want to use ES6 modules in a browser and I'm willing to only support new browsers to do it
      • This module works great with the ?module query parameter of unpkg. If you specify type='module' in your script tag, you'll be able to import simple-statistics directly - through index.js and with true ES6 import syntax and behavior.
        <script type='module'>
        import {min} from "https://unpkg.com/[email protected]/index.js?module"
        console.log(min([1, 2, 3]))
        </script>
        This feature is still experimental in unpkg and very bleeding-edge.

stream-statistics's People

Contributors

tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

stream-statistics's Issues

A getStats function?

Curious what you would think of a sort of getStats function that would allow you to get the data object without listening for an event? Something like

var ss = require('stream-statistics')();
require('fs').createReadStream('/tons/of/numbers').pipe(ss);
function poll() {
  setTimeout(function() {
    var stats = ss.getStats();
    poll();
  }, 100);
}
poll();

broken NPM installation

Haven't looked into exactly why but installing via npm is currently broken.

โ–Š dbeardsley 00:19 ~ โ–ถ  npm install stream-statistics
npm http GET https://registry.npmjs.org/stream-statistics
npm http 304 https://registry.npmjs.org/stream-statistics
npm ERR! Error: EACCES, symlink '../stream-statistics/bin/sstatistics'
npm ERR!  { [Error: EACCES, symlink '../stream-statistics/bin/sstatistics']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '../stream-statistics/bin/sstatistics' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 2.6.21.7-2.fc8xen
npm ERR! command "/bin/node" "/bin/npm" "install" "stream-statistics"
npm ERR! cwd /home/dbeardsley
npm ERR! node -v v0.8.3
npm ERR! npm -v 1.1.43
npm ERR! path ../stream-statistics/bin/sstatistics
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, symlink '../stream-statistics/bin/sstatistics'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/dbeardsley/npm-debug.log
npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.