@sandrahoang686/random-games v1.0.2
@sandrahoang686/random-games
This is Sandra's npm package library of random command line game(s)
Structure
Root
- The basics of an npm project (package.json, etc).
index.js
is the main file where functions can be called from the published npm packageSrclib
folder contains the the modules of random games that can be played in this librarytests
folder contains the unit and integration testsconstants.js
file contains static constants that can be easily accessed anywherehelpers.js
file contains generic logic that be shared accross different modules
Modules
readline
Native. Allows ability to prompt users for input.
promisify
Native in Util's Module. Allows transformation of callback based functions to async functions.
Versioning & Publishing
This library is published to NPM and can be accessed publicly. When new features or bug fixes are added, for users to be able to access those changes you must publish a new version of this library. To version and publish, follow these instructions...
1. Run npm login
in command line if not already logged in.
2. In the package.json, increment the version
.
3. Run npm publish --access public
Now users should be able to access this library by running
npm install @sandrahoang686/random-games
. Then the user can import the games likeconst { tictactoe } = require('@sandrahoang686/random-games')
for example.
Testing
Jest
Testing framework used for unit and integration tests.
TODOs
- Finish unit testing the helper methods, the functions in the game modules and add integration testing.
- Add the functionality to let two human players play
- Add more games