👀 SaMathGen is NPM library that generates mathematical expressions for educational purposes. https://samathgen.js.org/
  • TypeScript 98.9%
  • JavaScript 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-04-03 12:05:08 +04:00
__tests__ fix bug in genDivisor() and wrote more tests 2022-02-16 11:52:20 +04:00
src fix bug in genDivisor() and wrote more tests 2022-02-16 11:52:20 +04:00
.gitignore add .DS_Store to .gitignore 2022-01-03 02:24:54 +04:00
.npmignore 0.1.4: reverting and editing .npmignore 2022-02-17 16:28:30 +04:00
babel.config.js Add Jest for testing SaMathGen! 2022-02-14 15:18:28 +04:00
jest.json fix bug in genDivisor() and wrote more tests 2022-02-16 11:52:20 +04:00
LICENSE Initial commit 2021-12-22 15:21:27 +04:00
package-lock.json Bump minimist from 1.2.5 to 1.2.6 2022-04-03 08:04:18 +00:00
package.json 0.1.4: reverting and editing .npmignore 2022-02-17 16:28:30 +04:00
README.md Update README with package.json 2022-02-14 10:26:33 +04:00
tsconfig.json 0.1.4: reverting and editing .npmignore 2022-02-17 16:28:30 +04:00

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:
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.