adventure-runner

2.0.2 • Public • Published

adventure-runner

Runner util for nodeschool adventures.

Install

$ npm install --save adventure-runner

Usage

If you are using adventure module to create your nodeshcool adventures:

Instead of doing something like:

var adventure = require('adventure');
var shop = adventure('example-adventure');
 
var problems = [ 'dinosaurs', 'robots', 'wowsers' ];
problems.forEach(function (prob) {
    shop.add(prob, function () { return require('./problems/' + prob) });
});
 
shop.execute(process.argv.slice(2));

You could do:

var runner = require('adventure-runner');
 
runner('example-adventure',[ 'dinosaurs', 'robots', 'wowsers' ]);

or

var runner = require('adventure-runner');
 
runner('example-adventure','./problems');

API

adventureRunner(name, problems)

name

Required
Type: string

Name of your adventure.

problems

Type: stirng or array

Path to your problems or array of problems.

License

MIT © hemanth

Package Sidebar

Install

npm i adventure-runner

Weekly Downloads

7

Version

2.0.2

License

MIT

Last publish

Collaborators

  • hemanth