{"id":16793474,"url":"https://github.com/mdp/pitboss","last_synced_at":"2025-04-11T00:01:23.090Z","repository":{"id":4772749,"uuid":"5924201","full_name":"mdp/pitboss","owner":"mdp","description":"Run dubious code in node!","archived":false,"fork":false,"pushed_at":"2019-05-06T16:59:39.000Z","size":13,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T18:08:58.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-23T17:10:46.000Z","updated_at":"2019-05-06T16:59:40.000Z","dependencies_parsed_at":"2022-08-18T18:21:47.385Z","dependency_job_id":null,"html_url":"https://github.com/mdp/pitboss","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fpitboss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fpitboss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fpitboss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fpitboss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdp","download_url":"https://codeload.github.com/mdp/pitboss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838391,"owners_count":21004577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T08:49:25.337Z","updated_at":"2025-04-11T00:01:22.869Z","avatar_url":"https://github.com/mdp.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprication and better alternative\n\nThis library is old, unmaintained and not very useful. Please see [vm2](https://github.com/patriksimek/vm2#readme) if you're need something similar.\n\n[![Build\nStatus](https://secure.travis-ci.org/mdp/pitboss.png)](http://travis-ci.org/mdp/pitboss)\n\n![Pitboss](http://s3.amazonaws.com/img.mdp.im/renobankclubinside4.jpg_%28705%C3%97453%29-20120923-100859.jpg)\n\n# Pitboss\n## A module for running untrusted code\n\n\n### Runs JS code and returns the last eval'd statement\n\n    code = \"\"\"\n      num = num % 5;\n      num;\n    \"\"\"\n    pitboss = new Pitboss(code)\n    pitboss.run {num: 23}, (err, result) -\u003e\n      assert.equal 3, result\n\n### Handles processes that take too damn long\n\n    code = \"\"\"\n      while(true) { num % 3 };\n    \"\"\"\n    pitboss = new Pitboss code\n      timeout: 2000\n    pitboss.run {num: 23}, (err, result) -\u003e\n      assert.equal \"Timeout\", err\n\n### Doesn't choke under pressure(or shitty code)\n\n    code = \"\"\"\n      What the fuck am I writing?\n    \"\"\"\n    pitboss = new Pitboss code\n      timeout: 2000\n    pitboss.run {num: 23}, (err, result) -\u003e\n      assert.equal \"VM Syntax Error: SyntaxError: Unexpected identifier\", err\n\n### Doesn't handle this! But 'ulimit' does!\n\n    code = \"\"\"\n      str = ''\n      while(true) { str = str + \"Memory is a finite resource!\" };\n    \"\"\"\n    pitboss = new Pitboss code\n      timeout: 10000\n    pitboss.run {num: 23}, (err, result) -\u003e\n      assert.equal \"Process failed\", err\n\nAnd since Pitboss forks each process, ulimit kills only the runner\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdp%2Fpitboss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdp%2Fpitboss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdp%2Fpitboss/lists"}