1.0.6 • Published 5 years ago

@perreh/js-calculator v1.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

JS Calculator

A lightweight javascript library for parsing calculations as an example for the revealing module pattern and testing with Jasmine.

Usage

In a browser using CDN:

<script src="https://unpkg.com/@perreh/js-calculator@1.0.6/dist/calc.bundle.js"></script>

<script>
    calc(3).add(5); //returns 8
</script>

Using npm:

npm -i --save @perreh/js-calculator

In Node.js

var calc = require('@perreh/js-calculator');

calc(3).add(5); //returns 8

Building

Take a copy of the code if you want to make changes or build the bundle yourself. eslint is used in the build to test code against a style guide.

git clone https://github.com/perryjsteward/js-calculator.git
cd js-calculator
npm install
npm build

build will bundle the file into /dist

Testing

Test the package using Jasmine against original index.js:

npm run test

To test a specific spec file (-- -- is not a typo):

npm test -- --filter="Calculator Minus"

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago