Skip to content
A recorder for JavaScript, that allows you to capture calls and replay them onto a given function.
CoffeeScript JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
src
test
.gitignore
.travis.yml
Gruntfile.coffee
LICENSE
README.md
bower.json
package.json

README.md

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)

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)

Something went wrong with that request. Please try again.