minesweeperjs

1.0.0 • Public • Published

npm GitHub release (latest by date) GitHub issues

MinesweeperJS

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

Installation

Client-side : In the browser (in HTML page)

CDN (jsdelivr)

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, since v0.6.0). Import it in your web page :

<script src="https://cdn.jsdelivr.net/npm/minesweeperjs@0.6.0/lib/client.min.js"></script>

Now you can play with the library in the console or in a script.

Download and use as local file

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.

Server-side: With NPM

For the moment, the package is called minesweeperjs. You can install it in a Node project with the following command :

npm install minesweeperjs

Then, import it in your project (in a Javascript file)

// Just what you need
const { Grid } = require('minesweeperjs')
 
// Or all fonctions and classes
const { Grid, Cell, Checker, MsInstalled } = require('minesweeperjs')

Now, you can use Grid as a class in Node.

Get started

Build your first grid

// 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
}); 

Learn how to play

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.

Contributing

Want to contribute ?

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.

Contributors Z

Found a bug / Need help ?

Please open an issue (on GitHub) to request a change or report an issue.

License

MinesweeperJS is licensed under the MIT License.

Package Sidebar

Install

npm i minesweeperjs

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

27.2 kB

Total Files

12

Last publish

Collaborators

  • dono7