New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

randomath

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randomath

Random math examples of addition, subtraction, multiplication and division with fake answers and true ones.

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Randomath library

Just a simple JavaScript math library that creates random math examples of addition, subtraction, multiplication and division with fake answers and true ones.

Usage

const Randomath = require('randomath');
const math = new Randomath();

Methods

getRandomAdd(times) — returns a random addition example.

getRandomSubtract(times) — returns a random subtraction example.

getRandomMultiply(times) — returns a random multiplication example.

getRandomDivide(times) — returns a random division example.

getRandomCompare(times) — returns a random comparison example.

 

Output example of getRandomAdd method

[
  {
    example: '48 + 39',
    answers: [ 91, 87, 90 ],
    answer: 87,
    answerId: 1
  }
]

 

Default number of examples is one. You can change it by replacing times to the number of repeats you need. For example getRandomAdd(3) will return 3 addition examples.  

Each method returns an array of objects.

Keywords

FAQs

Package last updated on 01 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc