replay.js

0.0.4 • Public • Published

replay.js

A simple recorder/proxy generator for JavaScript, that allows you to capture method calls and replay them onto a given function/scope at a later point in time.

Build Status NPM version Dependency Status devDependency Status

Test

grunt test or for dev mode grunt watch:test

Installation

npm install replay.js or just load within a browser (works with CommonJS, AMD and Vanilla JS)

Versions

  • 0.0.1: Initial version

Usage

The following example records calls to the recorder and then replays them onto the console.

var ReplayJS = require('replay.js');

var recorder = ReplayJS.recorder();

recorder('Hello', 'World');
recorder('Hello', 'you');

ReplayJS.play(recorder, console.log, console);
// Hello World
// Hello you
var ReplayJS = require('replay.js');

var recorder = ReplayJS.recorder();

recorder(1);
recorder(2);
recorder(3);

var arr = [];
ReplayJS.play(recorder, Array.prototype.push, arr);
// arr = [1,2,3]

License

MIT (see LICENSE file)

Readme

Keywords

none

Package Sidebar

Install

npm i replay.js

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • joscha