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

storm-js

v0.3.2

Published

An advanced performance/optimization testing library for Node.

Downloads

9

Readme

#Storm Because thinking is hard.

Build Status Coverage Status NPM Dependencies

Problem solving is not easy. Whether it is building a thorough dataset for brute force approaches or managing a huge number of asynchronous actions, most of your time is spent preparing to solve the problem instead of just solving it. But don't worry! Fortunately for you computers are very good at math. And better methods for finding optimal solutions are all around us (and with far better results).

Storm is built around solving complex problems through simple genetic algorithms. Define the parameter settings, specify a scoring method and let Storm run it's course to crunch all that data. When it's over, you'll get a report that includes total tests run, timing data, best and worst results, and more.

Example:

import {Storm, RandomInteger} from 'storm';

// The equation we are trying to optimize!
const quadratic = function (x, y) {
  return -2*Math.pow(y, 2) + 3*Math.pow(x, 2) + 8*x*y + -6*x + 4*y + 2;
};

let storm = new Storm({
  params: {
    x: new RandomInteger(1, 20),     // [1,2, ..., 20]
    y: new RandomInteger(-10, 10) // [-10, -8, ..., 20]
  },
  generationSize: 10, // Work with 10 solutions at a time.
  limit: 10, // limit to 10 generations (may also be a function)
  run: (params) => {
    // Just pass the parameters to the module to test.
    return quadratic(params.x, params.y);
  },
  score: function (result) {
    // Invert the absolute results (closer to zero is the goal)
    return 1 / Math.abs(result);
  }
});

storm
  .start()
  .then(results => {
    console.log('Min:', results.min);
    console.log('Max:', results.max);
    console.log('All:', results.all);
  });

Features:

  • Simple yet flexible API
  • Built around async operations (via Promises)
  • Stream enabled (perfect for massive data-sets)
  • Built-in data tools for defining characteristics about the parameters
  • Automatically handles crossover and mutation (but can be overridden)

Contribute

  1. Fork it
  2. npm i -g ava typescript gulp
  3. npm i
  4. gulp watch
  5. Make changes and write tests.
  6. Send pull request! :sunglasses:

License:

MIT