{"id":17987320,"url":"https://github.com/taniarascia/snek","last_synced_at":"2025-09-10T05:45:32.671Z","repository":{"id":45768617,"uuid":"179384270","full_name":"taniarascia/snek","owner":"taniarascia","description":"🐍 ‎ A terminal-based Snake implementation written in JavaScript.","archived":false,"fork":false,"pushed_at":"2021-10-22T21:56:14.000Z","size":93,"stargazers_count":273,"open_issues_count":0,"forks_count":44,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T03:45:34.876Z","etag":null,"topics":["game","javascript","node","snake"],"latest_commit_sha":null,"homepage":"https://www.taniarascia.com/snake-game-in-javascript/","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/taniarascia.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":"2019-04-03T23:14:34.000Z","updated_at":"2025-03-18T11:06:15.000Z","dependencies_parsed_at":"2022-08-30T23:21:45.009Z","dependency_job_id":null,"html_url":"https://github.com/taniarascia/snek","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fsnek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fsnek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fsnek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taniarascia%2Fsnek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taniarascia","download_url":"https://codeload.github.com/taniarascia/snek/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027411,"owners_count":21035594,"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":["game","javascript","node","snake"],"created_at":"2024-10-29T19:08:23.140Z","updated_at":"2025-04-09T11:12:09.348Z","avatar_url":"https://github.com/taniarascia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐍 Snek.js \n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![snekjs on NPM](https://img.shields.io/npm/v/snekjs.svg?color=green\u0026label=snekjs)](https://www.npmjs.com/package/snekjs)\n\n[![Run on Repl.it](https://repl.it/badge/github/taniarascia/snek)](https://repl.it/github/taniarascia/snek)\n\nA terminal-based Snake implementation written in JavaScript (Node.js).\n\n### [Read the tutorial](https://www.taniarascia.com/snake-game-in-javascript/)\n\n![snek.gif](https://raw.githubusercontent.com/taniarascia/snek/master/snek.gif)\n\n## Instructions\n\nUse the arrow keys (`↑`, `↓`, `←`, `→`) or `W` `A` `S` `D` to navigate the snake up, down, left, or right. Eat the red dot to gain points. If the snake collides with the wall or its own tail, it's game over. Press `ENTER` to restart, and `Q`, `ESCAPE` or `CTRL` + `C` to quit the game.\n\n## Installation\n\n### Run without installing\n\nThe easiest way to play the game is to just run it in the terminal without installing anything!\n\n```bash\nnpx taniarascia/snek\n```\n\n### Clone from repository\n\n```bash\ngit clone https://github.com/taniarascia/snek\ncd snek\n\n# install and run via npm or yarn\nnpm i \u0026\u0026 npm run play\n```\n\n### npm module\n\nAdd the `snekjs` module.\n\n```bash\nnpm i snekjs\n```\n\nCreate the game.\n\n```js\n// index.js\nconst { UserInterface, Game } = require('snekjs')\nconst game = new Game(new UserInterface())\n\n// Begin game\ngame.start()\n```\n\nRun the game.\n\n```bash\nnode index.js\n```\n\n## Acknowledgements\n\n- [Vanya Sergeev](https://sergeev.io) for pointing out my snake collision bug, for advising me to make a single, reusable draw method, for showing me how to properly bind methods between classes, and for overall guidance and inspiration.\n- [Devin McIntyre](https://www.dev-eloper.com/) for general advice.\n- Panayiotis Nicolaou's [JavaScript Snake for Web](https://medium.freecodecamp.org/think-like-a-programmer-how-to-build-snake-using-only-javascript-html-and-css-7b1479c3339e) for initial logic.\n\n## Author\n\n- [Tania Rascia](https://www.taniarascia.com)\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaniarascia%2Fsnek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaniarascia%2Fsnek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaniarascia%2Fsnek/lists"}