{"id":20760348,"url":"https://github.com/vanng822/pstarter","last_synced_at":"2026-05-27T21:31:27.866Z","repository":{"id":3864360,"uuid":"4949728","full_name":"vanng822/pstarter","owner":"vanng822","description":"Start and manage (http) worker process for nodejs","archived":false,"fork":false,"pushed_at":"2017-07-19T09:19:28.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-13T05:31:36.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanng822.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-08T20:46:01.000Z","updated_at":"2019-01-25T09:18:17.000Z","dependencies_parsed_at":"2022-09-01T08:51:22.871Z","dependency_job_id":null,"html_url":"https://github.com/vanng822/pstarter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vanng822/pstarter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fpstarter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fpstarter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fpstarter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fpstarter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanng822","download_url":"https://codeload.github.com/vanng822/pstarter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fpstarter/sbom","scorecard":{"id":916073,"data":{"date":"2025-08-18","repo":{"name":"github.com/vanng822/pstarter","commit":"2f6bc2eae3906f5270e38a6a2613a472aabf8af6"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}}]},"last_synced_at":"2025-08-24T21:02:36.785Z","repository_id":3864360,"created_at":"2025-08-24T21:02:36.785Z","updated_at":"2025-08-24T21:02:36.785Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-17T10:13:15.744Z","updated_at":"2026-05-27T21:31:27.851Z","avatar_url":"https://github.com/vanng822.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage example at http://sibox.isgoodness.com\n\n\tvar pstarter = require('pstarter');\n\t\n\tpstarter.startMaster(__dirname + '/config/configs.js', {}, function() {\n\t\tvar config = require('./config/configs.js');\n\t\tpstarter.statServer(config.http.statPort, config.http.statHost);\n\t\tif (process.env['NODE_ENV'] \u0026\u0026 process.env['NODE_ENV'] == 'development') {\n\t\t\tpstarter.startWatch(__dirname, [__dirname +'/node_modules'], ['.js', '.json', '.html', '.css']);\n\t\t}\n\t}).startWorker(function() {\n\t\tvar config = require('./config/configs.js');\n\t\n\t\tvar express = require('express');\n\t\tvar bootstrap = require('./app/bootstrap.js');\n\t\tvar app = express.createServer();\n\t\n\t\tbootstrap.setupApp(app, __dirname);\n\t\tbootstrap.bootstrap(app);\n\t\tbootstrap.postrun();\n\t\tapp.listen(config.http.port, config.http.ip);\n\t});\n\n## Or run separate worker file\n### master.js\n\tvar pstarter = require('pstarter');\n\n\tpstarter.startMaster({}, {exec: './worker.js'});\n\t\n### worker.js\n\tvar pstarter = require('pstarter');\n\tpstarter.startWorker(function() {\n\t\tconsole.log('Hello world!');\n\t});\n\n## Methods\n### startMaster(confFile, masterSettings, callback)\n* `confFile` - configuration file or object. Only PID_FILE and http.numWorkers are used at the moment\n* `masterSettings` - See http://nodejs.org/api/cluster.html#cluster_cluster_setupmaster_settings\n* `callback` - function which will be called when master has forked workers\n\n### startWorker(callback, cleanupCallback)\n* `callback` - will call when worker has attached listener on exit signal\n* `cleanupCallback` - will call when worker receives exit signal. It pass a function for terminating process (or you can choose to exit).\n\n### startWatch(root, skipFolders, exts)\n* `root` top folder to watch, all subfolder will also be watched\n* `skipFolders` Array of folders you want to skip, absolute path\n* `exts` Array of extension to listen on changes, including \".\" \n\n### statServer(port, host)\n* `port` port to run stat server\n* `host` host to run stat server\n\n## Start with init script on Ubuntu\n\nYou need to create a symbolic link /etc/init.d/pstarter to pstarter/etc/init.d/pstarter and make pstarter executable.\nYou need also specify NODE_BIN, SERVER, PID_FILE, AS_USER, NODEJS and NODE_ENV if your application uses it:\n* `NODE_BIN` folder which contains SERVER\n* `SERVER` application/server file to execute\n* `PID_FILE` should be /var/run/pstarter.pid in production linux\n* `AS_USER` the username or uid that you want to run your app (worker) with\n* `NODEJS` executable nodejs \n* `NODE_ENV` for your own application; normally development/production\n\n\n### Start workers\n\n\tsudo /etc/init.d/pstarter start\n\n\n### Old workers will exit directly and new workers created\n\n\tsudo /etc/init.d/pstarter restart\n\t\n\t\n\n### Old workers will exit graceful one at the time and replaced with a new one\n\t\n\tsudo /etc/init.d/pstarter graceful\n\t\n\n### Run stop (bellow) and start command will be executed\n\n\tsudo /etc/init.d/pstarter force-restart\n\n### Old workers exit directly; parent exits\n\n\tsudo /etc/init.d/pstarter stop\n\t\n## Register init script for startup at reboot in Ubuntu\n\n\tcd /etc/init.d/\n\tsudo update-rc.d pstarter defaults\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanng822%2Fpstarter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanng822%2Fpstarter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanng822%2Fpstarter/lists"}