MinesweeperJS is a free 'Minesweeper' game javascript library. It is efficent and easy to install and use. Ideal to start a basic web game, for junior web developpers.
This is an open source library, so can you can use it for free. You can also contribute, suggest improvements, or report a bug. If you like this project, please Star it, so that we can reach
We can use a link to the NPM package lib file to import the script in the client-side (where you can set whatever version you want in the file name). This is possible since v0.3.4. Import it in your web page :
<script src="https://cdn.jsdelivr.net/npm/play-minesweeperjs@0.3.4/lib/client.min.js"></script>
Now you can play with the library in the console or in a script.
You can also download the last version in the lib folder, and then import it in your project. Then, link it as a script in the head of your HTML file.
For the moment, the package is called play-minesweeperjs
. You can install it in a Node project with the following command :
npm install play-minesweeperjs
Then, import it in your project (in a Javascript file)
// Just what you need
const { Grid } = require('play-minesweeperjs')
// Or all fonctions and classes
const { Grid, Cell, Checker, MsInstalled } = require('play-minesweeperjs')
Now, you can use Grid as a class in Node.
// Build a default 9x9 grid
var g = new Grid();
// Build a custom 15x20 grid
var g = new Grid({
width: 15,
height: 20
});
// All the options
var g = new Grid({
width: 10,
height: 10,
name: "An easy grid",
nbbombs: 10
});
See the Get started guide to learn how to play and use this library. See the Methods list available and optional parameters to see the complete guide.
You want to suggest new features ? Please open an issue (on GitHub).
You are a developer ? Take a look at the to do list to see if you can help me improving this repo. If you want to add something that is not in the To Do List, you can also make a Pull Request.
- @Dono7 (Creator)
Please open an issue (on GitHub) to request a change or report an issue.
MinesweeperJS is licensed under the MIT License.