1.0.0 • Published 8 years ago

addition-webdevjeffus.js v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

Node Modules and NPM

This repository was created as part of Dev Bootcamp's Adaptor course on MEAN Stack development. It includes a module, addition-webdevjeffus.js that was published to npm as a learning activity.

addition-webdevjeffus.js

This is a JavaScript module that adds numbers together.

Install

npm install addition-webdevjeffus

Usage

This module has one function: to add numbers together. It was created as a practice exercise, and was never meant for "real-world" use.

That being said, the module has two API methods, which take numbers as arguments. The namespace for the module is "addUp", which doesn't match the name of the package becauseonce againit was created as an assignment, and the package name was defined in the instructions.

API

addUp.these(x, y)

Returns the sum of two numbers, x and y.

var addUp = require('addition-webdevjeffus');

addUp.these(3, 4); // Returns 7

addUp.allThese( args )

Takes either an array of numbers, or any number of numbers, as arguments, and returns the sum of all the numbers together.

var addUp = require('addition-webdevjeffus');

addUp.allThese( [3, 4, 5] ); // Returns 12
addUp.allThese( 1, 2, 3, 4 ); // Returns 10

Contributing

Don't bother. I won't be maintaining this beyond this weekend myself, most likely.

Changelog

All changes to the project will be documented in this file.

Disclaimer

This module adds as well, or as badly, as JavaScript itselfall standard warnings about rounding and other errors apply.

The MIT License (MIT)

Copyright © 2016 by Jeff George

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.