npm.io
0.1.3 • Published 4 years ago

samathgen

Licence
GPL-v3.0
Version
0.1.3
Deps
0
Size
51 kB
Vulns
0
Weekly
0
Stars
1

SaMathGen

NPM library that generates math expressions for education purposes.
You can report bug or request feature

Stargazers Forks Issues License

Table Of Contents

About The Library

Generating various math expressions independently, for example, for primary school educators — is a routine job.

This library can help you automate this process; it is enough to write the required arguments like expression's size, optionally brackets and other cool features.

There are no dependencies in this library, except TypeScript.

With by Azer Sadykhzadeh GitHub

Getting Started

So, you need to install Node.JS and generate Node.JS project in order to use SaMathGen library.

Prerequisites
Prerequisites There are several ways of installing Node.JS:
  • NVM - one of the easiest way
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
# restart terminal (https://github.com/nvm-sh/nvm#troubleshooting-on-linux)
nvm install --lts
Installation
  1. Create new Node.JS project
# works only in macOS & Linux
mkdir new_project && cd new_project
# for Windows just create new folder and open it in cmd

npm init -y
  1. Install SaMathGen
npm install samathgen
  1. That's it! ^_^

Usage

  1. Create index.js(or .ts) and type this example:
const { mathGen } = require("samathgen");
const expression = mathGen(3, {
  "answer": 40,
  "brackets": false,
  "quizOptions": true
});
console.log(expression);
  1. Type node index.js (or .ts) in console and check output!
> node index.js
{
  task: [ 100, '/', 5, '+', 20 ],
  answer: 40,
  quizOptions: [ 41, 40, 38, 30 ]
}

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create.

Any contributions you make are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Please make sure your pull request is not a duplicate of an existing issue.
Creating A Pull Request
  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under GNU General Public License v3.0. See LICENSE for more information.

Keywords