npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@csd-angola1/game-engine

v1.1.0

Published

The game engine is a simple machine. It may start a game or compute a guess, and it will always return a `game_status`:

Downloads

9

Readme

The Game Engine

The game engine is a simple machine. It may start a game or compute a guess, and it will always return a game_status:

{
  status: RUNNING,
  word: 'banana',
  guesses: ['a', 'b', 'c', 'd'],
  display_word: 'b a _ a _ a',
  lives: 3 // Initial 5 - 2 wrong guesses
}

💡 Exercise 1: Packages and Build Automation 💡

Add the package you just created to your package.json file and try it! Well, if you did everything right, a strange error will appear.

Fix this error (you might need to change the random_line package), and update your package.json if needed.

💡 Exercise 2: TDD, Code Coverage and Real Time Development 💡

Now it's time to finish the game engine. But now we're getting pretty picky with code coverage, and your implementation must adhere to our policy.

While you're at it, try to add a new script to your package.json file using the options watch and notify from jest. You can check the documentation here. This way you're going to try REAL TIME DEVELOPMENT!

Go for it!

💡 Exercise 3: Continuous Integation and Cndontinuous Delivery 💡

The whole CI magic happens in the file .gitlab-ci.yml. It's already testing, but it could be publishing your new library at the end of the pipeline. Try adding a new step named deploy and running npm publish --access public on it.

Oh, and don't forget to increment your version before doing that, or you'll receive an error.

TIP: Instead of changing your package.json file, try the following command: npm version patch

💡 Exercise 4: Code Smells and Code Quality 💡

What is a code smell? Some signs that our code isn't that good. What are some examples of code smells?

  • Giant functions
  • A function that takes 8 arguments
  • A single file with 4500 lines of code
  • Magic Numbers

This list can go on and on, and some code smells are specific to certaing paradigms and languages. Take some time to reflect with your team: what is a code smell to you?

Now, let's automate the code smell detection. Some of these smells can be automated by using JSHint, and that's waht we're going to do!