This library is old, unmaintained and not very useful. Please see vm2 if you're need something similar.
code = """
num = num % 5;
num;
"""
pitboss = new Pitboss(code)
pitboss.run {num: 23}, (err, result) ->
assert.equal 3, result
code = """
while(true) { num % 3 };
"""
pitboss = new Pitboss code
timeout: 2000
pitboss.run {num: 23}, (err, result) ->
assert.equal "Timeout", err
code = """
What the fuck am I writing?
"""
pitboss = new Pitboss code
timeout: 2000
pitboss.run {num: 23}, (err, result) ->
assert.equal "VM Syntax Error: SyntaxError: Unexpected identifier", err
code = """
str = ''
while(true) { str = str + "Memory is a finite resource!" };
"""
pitboss = new Pitboss code
timeout: 10000
pitboss.run {num: 23}, (err, result) ->
assert.equal "Process failed", err
And since Pitboss forks each process, ulimit kills only the runner