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

taxy

v0.1.1

Published

taxy is an extension of galaxy that adds additional functionality similar to that of C#

Downloads

2

Readme

taxy

Taxy is an extension of galaxy that adds additional functionality similar to that of .NET. Taxy inherits the entire set of functionality provided by galaxy in addition to its own.

NOTE: node must be run with --harmony. In order to use taxy as it uses ES6 features.

Classes

taxy.completion

A class that creates a future that returns when the complete method is called. Comparable to .NET's TaskCompletionSource.

Usage

code

var taxy = require('taxy');

taxy.main(function* () {

  var completion = new taxy.completion();

  console.log(new Date());
  setTimeout(function () {
    completion.complete();
  }, 2000);

  yield completion.future();
  console.log(new Date());

});

output

Sat Aug 08 2015 19:19:35 GMT-0700 (Pacific Daylight Time)
Sat Aug 08 2015 19:19:37 GMT-0700 (Pacific Daylight Time)

API

taxy.delay(ms)

Returns after the specified interval. Based on setTimeout(). Comparable to .NET's Task.Delay.

Parameters

  • ms: The number of milliseconds to delay.

Usage

code

var taxy = require('taxy');

taxy.main(function* () {

  console.log(new Date());
  yield taxy.delay(2000);
  console.log(new Date());

});

output

Sat Aug 08 2015 19:10:11 GMT-0700 (Pacific Daylight Time)
Sat Aug 08 2015 19:10:13 GMT-0700 (Pacific Daylight Time)

taxy.rest()

Pauses execution and resumes after the functions currently in the queue have finished. This is based on setImmediate and allows a lengthy operation to execute without strangling the thread.

Usage

code

var taxy = require('taxy');

taxy.main(function* () {

  console.log('Before');
  yield taxy.rest();
  console.log('After');

});

output

Before
After

taxy.whenAll(futures)

Returns after all given future objects have completed. Comparable to .NET's Task.WhenAll.

Return value

An array consisting of the results of all of the given futures.

Parameters

  • futures: an array of future objects to be yielded.

Usage

var taxy = require('taxy');

var foo = function* () {
  yield taxy.delay(200);
  console.log('foo');
  return 'foo';
};

var bar = function* () {
  yield taxy.delay(300);
  console.log('bar');
  return 'bar';
};

taxy.main(function* () {

  var fooFuture = taxy.spin(foo());
  var barFuture = taxy.spin(bar());

  var result = yield taxy.whenAll([fooFuture, barFuture]);
  console.log('whenAll completed. Result: ' + result);

});

output

foo
bar
whenAll completed. Result: foo,bar

taxy.whenAny(futures)

Returns after the first of the given future objects has completed. Comparable to .NET's Task.WhenAny.

Return value

The result of the first future to complete.

Parameters

  • futures: an array of future objects to be yielded.
var taxy = require('taxy');

var foo = function* () {
  yield taxy.delay(200);
  console.log('foo');
  return 'foo';
};

var bar = function* () {
  yield taxy.delay(300);
  console.log('bar');
  return 'bar';
};

taxy.main(function* () {

  var fooFuture = taxy.spin(foo());
  var barFuture = taxy.spin(bar());

  var result = yield taxy.whenAny([fooFuture, barFuture]);
  console.log('whenAny completed. Result: ' + result);

});

output

foo
whenAny completed. Result: foo
bar