Skip to the content.


SaMathGen

SaMathGen is NPM library that generates mathematical expressions for educational purposes.

Report Bug . Request Feature

Downloads Contributors Forks Stargazers Issues License

Table Of Contents

About The Project

Generating various mathematical expressions with answer options independently, for example, for primary school teachers — is a routine job.

This library will help automate this process; it is enough to write the required arguments like expression’s length, optionally brackets and other cool features.

Built With

Getting Started

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

Prerequisites

There are several ways of installing NodeJS:

Installation

  1. Create new Node.JS project
# works only in macOS & Linux, for Windows just create new folder and open it in cmd
mkdir new_project && cd new_project
  1. After Installing Node.JS, initialize your Node.JS project and install SaMathGen
npm init -y && npm i samathgen
  1. That’s it! :D

Usage

  1. Create index.js(or .ts) and type this example:
const { mathGen } = require("samathgen");
console.log(mathGen(3, {
  "answer": 40,
  "brackets": false,
  "quizOptions": true
}));
  1. Type node index.js (or .ts) in console and that’s it! 🥳
> 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.

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 the MIT License. See LICENSE for more information.

Author

Acknowledgements