simple-math-replace.js

1.0.0 • Public • Published

Simple-Math-Replace.js

It is a simple to use simple math calculations like +, -, /, multiplication. You can also replace strings using this package! Installation

$ npm install simple-math-replace.js 

Examples For math calculations

const maths = require("simple-math-replace.js");
console.log(maths.cal(15, "*", 3))
// Would log 45
console.log(maths.cal(15, "+", 3))
// Would log 18
console.log(maths.cal(15, "-", 3))
// Would log 12
console.log(maths.cal(2, "/", 15))
// Would log 5

For replacement of strings

let Regex = new RegExp(/hi/gi);
let Str = "Hi How are you. hi hi hi";
console.log(maths.replace(Str, Regex, "hello"));
// This would check all capitalizations of what ever is in our regex, the captalization does not matter because of the "/gi".
//Would log:- hello How are you. hello hello hello

Thank you!

Readme

Keywords

Package Sidebar

Install

npm i simple-math-replace.js

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.21 kB

Total Files

4

Last publish

Collaborators

  • rubayz