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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tartjs

v0.0.0

Published

Tiny Actor Run-Time in JavaScript

Readme

tartjs

Stability: 1 - Experimental

NPM version

JavaScript implementation of Tiny Actor Run-Time.

Contributors

@dalnefre, @tristanls

Usage

var Tart = require('tartjs');

var config = new Tart();

// create an actor that has no state and can't change behavior
var actor = config.createActor(function (event) {
    console.log('got message', event.message);
    console.dir(event);
});

// create a value actor that has state, but can't change behavior
var value = config.createValue(function (event) {
    console.log('got message', event.message); 
    console.log('actor state', event.data);
    console.dir(event);
}, {foo: 'bar'});

// create a serial actor that has state and can change behavior
var serial = config.createSerial(function (event) {
    console.log('got message', event.message);
    console.log('actor state', event.data);
    console.log('becoming something else');
    console.dir(event);
    
    event.sponsor.send(event.target, event.message);
    event.become(function (event) {
        console.log('got message with new behavior', event.message);
        console.dir(event);
    });
}, {foo: 'bar'});

config.send(actor, 'some message');
config.send(value, {some: 'other message'});
config.send(serial, {message: 'with', reference: actor});

Tests

npm test

Benchmarks

Erlang Challenge

Erlang Challenge consists of creating a ring of M actors, sending N simple messages around the ring and increasing M until running out of resources.

The benchmark implements a modified version of the challenge by creating 100,000 actors and running 10 simple messages around the ring.

npm run erlangChallenge
constructed 100000 actor ring
..........
done
all times in NANOSECONDS
construction time:
2900829022
loop times:
627685921
631848011
666029990
731236694
775333540
615891053
612743213
684856367
721228999
769791008
611477526
loop average:
677102029.2727273

Overview

The goal of tartjs is to provide the smallest possible actor library in JavaScript that has the full power of a "pure" actor model of computation.

Configurations

TODO

Actors

Actors consist only of behaviors and maintain no internal state. To create a new actor:

var Tart = require('tartjs');
var config = new Tart();
var actor = config.createActor(function (event) { /* ... */ });

Value Actors

Value actors consist of behaviors and state, but cannot change the behavior. To create a new value actor:

var Tart = require('tartjs');
var config = new Tart();
var value = config.createValue(function (event) { /* ... */ }, { /* state */ });

Serial Actors

Serial actors have state and can change their behaviors by using event.become() function. To create a new serial actor:

var Tart = require('tartjs');
var config = new Tart();
var serial = config.createSerial(function (event) { /* ... */ }, { /* state */ });

Documentation

TODO

Sources