
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
text-calculator
Advanced tools
Text calculator built with web speech API in mind but is able to translate text and calculate it. Was built for calculating 'math-speak'.
Text calculator built with web speech API in mind but is able to translate text and calculate it. Was built for calculating 'math-speak'.
1.1.0
$ npm i --save text-calculator
Pass in a text query with basic math formulas. Note: It does not handle parenthesis as people do not say usually say "open parenthesis five plus six close parenthesis times 4" to mean "(5 + 6) * 4".
var textCalculator = require('text-calculator');
// takes in a text string and returns calculation result as a number or 'error' text if it does not understand the mathQuery given
textCalculator.calculate(mathQuery, (result) => {
console.log(result); //
});
// Examples math query input and output:
'fifty-one plus five' --> 56
'fifty-one + 5' --> 56
'million and 45' --> 1000045
'million one hundred' --> 1000100
'sdfdsfhjkdf' --> 'error'
'parenthesis million parenthesis one hundred' --> 'error'
'5 exponent 2' --> 25
'5 to the power of 2' --> 25
'6 ^ 5' --> 7776
'5 mod 2' --> 1
'5 divided by 2' --> 2.5
'four divide four' --> 1
'square root of 4' --> 2
'million plus one tenth' --> 1000000.1
'half' --> 0.5
'6 take away 3' --> 3
'6 minus 3' --> 3
'5 cubed' --> 125
'6 squared' --> 36
and many more...
MIT
FAQs
Text calculator built with web speech API in mind but is able to translate text and calculate it. Was built for calculating 'math-speak'.
The npm package text-calculator receives a total of 6 weekly downloads. As such, text-calculator popularity was classified as not popular.
We found that text-calculator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.