https://github.com/doowb/array-avg
Calculate the average of an array of numbers.
https://github.com/doowb/array-avg
Last synced: about 1 month ago
JSON representation
Calculate the average of an array of numbers.
- Host: GitHub
- URL: https://github.com/doowb/array-avg
- Owner: doowb
- License: mit
- Created: 2015-09-23T13:41:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-16T02:54:26.000Z (over 9 years ago)
- Last Synced: 2025-02-26T07:39:11.719Z (about 2 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# array-avg [](http://badge.fury.io/js/array-avg) [](https://travis-ci.org/doowb/array-avg)
> Calculate the average of an array of numbers.
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i array-avg --save
```## Usage
```js
var avg = require('array-avg');avg([1, 2, 3, 4, 5]);
//=> 3avg(['1', '2', 3, '4', 5]);
//=> 3avg([1, 'foo', 2, 4, {}, 5]);
//=> 2
```## Related projects
[array-sum](https://www.npmjs.com/package/array-sum): Add up all of the numbers in an array of numbers. Works when non-numbers are… [more](https://www.npmjs.com/package/array-sum) | [homepage](https://github.com/jonschlinkert/array-sum)
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/array-avg/issues/new).
## Author
**Brian Woodward**
+ [github/doowb](https://github.com/doowb)
+ [twitter/doowb](http://twitter.com/doowb)## License
Copyright © 2015 Brian Woodward
Released under the MIT license.***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 23, 2015._