{"id":27430187,"url":"https://github.com/the2alert/node-samp","last_synced_at":"2025-07-30T12:05:50.391Z","repository":{"id":143788445,"uuid":"445454158","full_name":"The2Alert/node-samp","owner":"The2Alert","description":"Runtime environment Node.js in SA-MP","archived":false,"fork":false,"pushed_at":"2022-03-04T13:39:00.000Z","size":70,"stargazers_count":21,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T14:58:55.514Z","etag":null,"topics":["nodejs","nodesamp","plugin","runtime","sa-mp"],"latest_commit_sha":null,"homepage":"","language":null,"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/The2Alert.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-01-07T08:42:22.000Z","updated_at":"2025-04-11T09:01:37.000Z","dependencies_parsed_at":"2024-03-08T12:27:44.487Z","dependency_job_id":null,"html_url":"https://github.com/The2Alert/node-samp","commit_stats":null,"previous_names":["the2alert/node-samp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/The2Alert/node-samp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The2Alert%2Fnode-samp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The2Alert%2Fnode-samp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The2Alert%2Fnode-samp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The2Alert%2Fnode-samp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The2Alert","download_url":"https://codeload.github.com/The2Alert/node-samp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The2Alert%2Fnode-samp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267865864,"owners_count":24157343,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["nodejs","nodesamp","plugin","runtime","sa-mp"],"created_at":"2025-04-14T14:32:08.160Z","updated_at":"2025-07-30T12:05:50.361Z","avatar_url":"https://github.com/The2Alert.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/dev2alert/node-samp\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/dev2alert/node-samp/main/big-logo.png\" width=\"250px\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    Runtime environment Node.js in SA-MP.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/dev2alert/node-samp/releases/\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/dev2alert/node-samp\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/dev2alert/node-samp/releases/\"\u003e\u003cimg src=\"https://img.shields.io/github/downloads/dev2alert/node-samp/total\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://nodejs.org/\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=node\u0026message=16.13.2\u0026color=green\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/dev2alert/node-samp\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/dev2alert/node-samp?style=social\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/dev2alert/node-samp/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/dev2alert/node-samp\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Documentation\n\u003cp\u003e\n    Documentation is \u003ca href=\"https://github.com/dev2alert/node-samp/wiki\"\u003ehere\u003c/a\u003e.\n\u003c/p\u003e\n\n## Getting started\nPreliminary requirements:\n\u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://nodejs.org/en/download/\"\u003eNode.js\u003c/a\u003e \u003e= \u003ccode\u003e16.13.2\u003c/code\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://www.npmjs.com/\"\u003enpm\u003c/a\u003e \u003e= \u003ccode\u003e8.1.2\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\nInstallation and start on TypeScript:\n```\ngit clone https://github.com/dev2alert/node-samp-starter.git my-server\ncd ./my-server\nnpm i\nnpm run compile\nnpm start\n```\nInstallation and start on JavaScript:\n```\ngit clone https://github.com/dev2alert/node-samp-javascript-starter.git my-server\ncd ./my-server\nnpm i\nnpm start\n```\nStart in development mode:\n```\nnpm run dev\n```\n\n## Getting Started with Docker\nPreliminary requirements:\n\u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://www.gnu.org/software/make/\"\u003eGNU Make\u003c/a\u003e \u003e= \u003ccode\u003e3.81\u003c/code\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://www.docker.com/\"\u003eDocker\u003c/a\u003e \u003e= \u003ccode\u003e20.10.12\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\nInstallation:\n```\ngit clone https://github.com/dev2alert/node-samp-docker-starter.git my-server\ncd ./my-server\nnpm i\n```\nBuild and run:\n```\nnpm run compile\nmake -B build\nmake run\n```\n\n## Example\nUsing Context API and TypeScript:\n```typescript\nimport {Group, Keys, Player, Position, Vehicle, Weapons} from \"@sa-mp/core\";\nimport {Alt, Command, Context, Key, Param, ParamInt} from \"@sa-mp/decorators\";\n\n@Context()\nexport class ModePlayer extends Player.Context {\n    public readonly vehicles: Group\u003cVehicle\u003e = new Group;\n\n    public onConnect(): boolean {\n        this.send(`Hello, ${this}!`);\n        return true;\n    }\n\n    public onRequestClass(): void {\n        this.spawnInfo({x: 1906.2207, y: -2429.4124, z: 13.5391, team: 0, skin: 68, rotation: 0, weapons: [{type: Weapons.AK47, ammo: 89}]});\n        this.spawn();\n    }\n\n    public onDisconnect(): void {\n        this.vehicles.destroy();\n    }\n\n    @Key(Keys.YES)\n    public handleKeyYes(): void {\n        this.spawn();\n    }\n\n    @Key(Keys.NO)\n    public handleKeyNo(): void {\n        this.vehicles.destroy();\n    }\n\n    @Command(\"spawn\")\n    @Alt(\"s\")\n    public spawnPlayer(): void {\n        this.spawn();\n    }\n\n    @Command(\"pos\")\n    public setPosition(@Param() x: number, @Param() y: number, @Param() z: number): void {\n        this.pos = {x, y, z};\n    }\n\n    @Command(\"veh\")\n    public createVehicle(@ParamInt() model: number, @ParamInt() color1: number, @ParamInt() color2: number): void {\n        const {x, y, z}: Position = this.pos;\n        const rotation: number = this.angle;\n        const vehicle: Vehicle = Vehicle.create({x, y, z, model, colors: [color1, color2], rotation});\n        if(this.isInAnyVehicle())\n            this.vehicle.destroy();\n        this.put(vehicle);\n        this.vehicles.push(vehicle);\n    }\n}\n```\n\n## Todo list\n\n- [x] Updating \u003ca href=\"https://nodejs.org/en/\"\u003eNode.js\u003c/a\u003e up to version 16.13.2!\u003cbr /\u003e\n- [x] Write documentation.\n- [x] Add \u003ca href=\"https://github.com/samp-incognito/samp-streamer-plugin\"\u003eStreamer\u003c/a\u003e plugin support.\n- [x] Add \u003ca href=\"https://github.com/Zeex/samp-plugin-crashdetect\"\u003eCrashDetect\u003c/a\u003e plugin support.\n- [x] Add \u003ca href=\"https://github.com/ziggi/FCNPC\"\u003eFCNPC\u003c/a\u003e plugin support.\n- [ ] Add \u003ca href=\"https://jestjs.io\"\u003eJest\u003c/a\u003e testing support.\n- [ ] Add \u003ca href=\"https://typeorm.io\"\u003eTypeorm\u003c/a\u003e support.\n- [ ] Add \u003ca href=\"https://github.com/CyberMor/sampvoice\"\u003eSAMPVOICE\u003c/a\u003e plugin support.\n- [ ] Add \u003ca href=\"https://github.com/ZOTTCE/samp-cef\"\u003eSAMP CEF\u003c/a\u003e plugin support.\n- [ ] Create SA-MP Extension.\n\n## Supported plugins\n\u003ctable align=\"center\"\u003e\n    \u003ctr\u003e\n        \u003cth\u003ePackage\u003c/th\u003e\n        \u003cth\u003ePlugin\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/dev2alert/node-samp-streamer\"\u003e\n                \u003cimg src=\"https://github-readme-stats.vercel.app/api/pin/?username=dev2alert\u0026repo=node-samp-streamer\" /\u003e \n            \u003c/a\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/samp-incognito/samp-streamer-plugin\"\u003e\n                \u003cimg src=\"https://github-readme-stats.vercel.app/api/pin/?username=samp-incognito\u0026repo=samp-streamer-plugin\" /\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/dev2alert/node-samp-crashdetect\"\u003e\n                \u003cimg src=\"https://github-readme-stats.vercel.app/api/pin/?username=dev2alert\u0026repo=node-samp-crashdetect\" /\u003e \n            \u003c/a\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/Zeex/samp-plugin-crashdetect\"\u003e\n                \u003cimg src=\"https://github-readme-stats.vercel.app/api/pin/?username=Zeex\u0026repo=samp-plugin-crashdetect\" /\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/dev2alert/node-samp-fcnpc\"\u003e\n                \u003cimg src=\"https://github-readme-stats.vercel.app/api/pin/?username=dev2alert\u0026repo=node-samp-fcnpc\" /\u003e \n            \u003c/a\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/ziggi/FCNPC\"\u003e\n                \u003cimg src=\"https://github-readme-stats.vercel.app/api/pin/?username=ziggi\u0026repo=FCNPC\" /\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Credits\n\u003cul\u003e\n    \u003cli\u003e\n        \u003ca href=\"https://github.com/AmyrAhmady/samp-node\"\u003esamp-node\u003c/a\u003e (\u003ca href=\"https://github.com/AmyrAhmady\"\u003eAmyrAhmady\u003c/a\u003e and \u003ca href=\"https://github.com/AmyrAhmady/samp-node#credits\"\u003eothers\u003c/a\u003e) - their code helped create \u003ca href=\"https://github.com/dev2alert/node-samp-plugin\"\u003eplugin\u003c/a\u003e.\n    \u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"https://github.com/pkfln\"\u003epkfln\u003c/a\u003e - invited to organization \u003ca href=\"https://www.npmjs.com/org/sa-mp\"\u003e@sa-mp\u003c/a\u003e in \u003ca href=\"https://www.npmjs.com/\"\u003enpm\u003c/a\u003e.\n    \u003c/li\u003e\n\u003c/ul\u003e\n\n## License\n\u003cp\u003e\n    \u003ca href=\"https://github.com/dev2alert/node-samp/blob/main/LICENSE\"\u003eMIT\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe2alert%2Fnode-samp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe2alert%2Fnode-samp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe2alert%2Fnode-samp/lists"}