Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 1.89 KB

README.md

File metadata and controls

78 lines (52 loc) · 1.89 KB

ebabel-library

Library of re-useable game functions to build web browser HTML5 games.

Use for your own game

Install as dependency for your own game

Bower

bower install --save ebabel-library

or, npm

npm install --save ebabel-library

Usage in your own game

See demos for how to use this library.

This library can be used in ES5 or ES6+

randomNumber

// ES5
<script src="dist/ebabel-library.min.js"></script>
<script>
  var result = window['ebabel-library'].randomNumber(7, 1).toInt()
</script>
// ES6+
import { randomNumber } from 'ebabel-library';

const result = randomNumber(7, 1).toInt();

License

This code is free to use for all purposes. For more details, see GNU General Public License, version 3.

Develop the library itself from source code

Fork the repository and once you have made your code changes, raise a pull request! Thanks in advance for any and all contributions.

Build from source

npm install
npm run build

The build is either for development or production. Update the value of NODE_ENV in the .env file.

Unit tests

npm test

Design principles

This library has no dependencies when executed in a browser. It's written with plain javascript and meant to be easily used in the context of a modern, standard compliant web browser.

Each function does just one thing and tries to do it well.

Each function is indenpendent from other functions.

Quotes

"Do one thing and do it well", Sitepoint.

"Do more with less", Chimeremeze Ukah.

npm and bower registries

Pushing a new tag is enough to update the bower registry, only the initial setup was required.

For npm, run npm publish to push a new tag version.