snake-cli-ts
TypeScript icon, indicating that this package has built-in type declarations

1.3.4 • Public • Published

snake-cli-ts

CLI Snake Game written in NodeJS and TypeScript

Install

npm i snake-cli-ts -g

Usage

# Just type in console:
snake

Example ss

Use as module

// CommonJS modules
const SnakeGame = require('snake-cli-ts').default;
// ES6 modules with Babel or TypeScript
import SnakeGame from 'snake-cli-ts';
const game = new SnakeGame({
  moveThroughWall: false,
  difficulty: 'easy',
}).on('gameOver', () => {
  console.clear();
  console.log(`Your score: ${game.snake.body.length} points`);
  process.exit();
}).init();

Readme

Keywords

Package Sidebar

Install

npm i snake-cli-ts

Weekly Downloads

1

Version

1.3.4

License

MIT

Unpacked Size

43.4 kB

Total Files

25

Last publish

Collaborators

  • akcyp