# amiwo

amiwo is a simple box of utility functions I'm using across various node applications

## Install

```sh
npm install amiwo
```

## Release notes
- **v5.1.x**: util > setProperty() support arrays or properties
- **v5.0.x**: refactored using bluebird Promise library instead of when; created stream library
- **v4.18.x**: removed $DEBUG proxy logger
- **v4.17.x**: util > added rmap(), toBoolean() method, hasOwnProperties() returns a number (vs. boolean)
- **v4.16.x**: rest > added executeIf() middleware and associated Jasmine tests; util > added deleteProperties(), addToSet(), unwind() methods ; db > added dropCollection(), findOne() methods to DBObject (andd their equivalent implementation for GenericDBObject); jasmine > added toBeAnArray() matcher
- **v4.15.x**: util > added round() and trunc()
- **v4.14.x**: Removed requirement to global
- **v4.13.x**: Added generic flatten() method to DBObject ; support for Mongo v3.4
- **v4.12.x**: Added jasmine customer matchers based on util's smartEqual()
- **v4.11.x**: Added doc (jsdoc)
- **v4.10.x**: util: added method map(), filter()
- **v4.9.x**: util: added method overwrite()
- **v4.8.x**: util: added method keys() and values(), toLowerCase() and toUpperCase() (functional programming helpers)
- **v4.7.x**: util: added method flattenArray()
- **v4.6.x**: util: added method setCharAt(); error: added InvalidIDError
- **v4.5.x**: util: method expressParam() now supports dotted names
- **v4.4.x**: session: added method Route::keepMethod()
- **v4.3.x**: test: added generic tests for DBObjects
- **v4.2.x**: db: Added Optimist Concurrency Check to DBObject save(), push() and addToSet() methods (and associated method in GenericMongoDBObject
- **v4.1.x**: util: Added setProperty() method
- **v4.0.x**: Added db & error suite

- **v3.1.x**: Added util::isValidEmail()
- **v3.0.x**: Added 'test' suite

- **v2.8.x**: RequestHandler & Route: added debug middleware supporting hot processing of debug & verbose parameters; minor edits in Session::init() middleware
- **v2.7.x**: util::request() now unwraps StatusCodeError from node-request module and returns its encapsulated Error directly
- **v2.6.x**: Added typeOf() and isObject() methods
- **v2.5.x**: Added native PerformanceTimer support to Route objects
- **v2.4.x**: Added Route::parallel() method
- **v2.3.x**: Added argv() method
- **v2.2.x**: Added Route object
- **v2.1.x**: Added PerformanceMonitor object
- **v2.0.x**: Added Session and RequestHandler objects

- **v1.18.x**: Fixed method clone() and smart(Deep)Equal() for Dates
- **v1.17.x**: Added method getProperty()
- **v1.16.x**: Enhanced min & max functions
- **v1.15.x**: Added addDays(), addMonths() and addYears() methods
- **v1.14.x**: Added average(), min(), max() methods
- **v1.13.x**: Improved merge() to work on more complex object structures
- **v1.12.x**: Added function getWeek(date) to get Date week number
- **v1.11.x**: Added function yesterday() and today() to get Date
- **v1.10.x**: Added functions get(obj, expr) getting properties from obj's keys matching 'expr'
- **v1.9.x**: Added functions flatten() and isObject()
- **v1.7.x / v1.8.x**: Added function request(), wrapping [request-promise](https://github.com/request/request-promise) to add a 'amiwo' parameter with a unique ID (generated by [node-uuid](https://github.com/broofa/node-uuid))
- **v1.6.x**: Added function hasOwnProperties(), isEmpty() now properly handles Date objects
- **v1.5.x**: Added function indexOf()
- **v1.4.x**: Added function expressParam() to replace the deprecated Express::Request::param() method
- **v1.3.x**: Added function add() to add a property/value to an Object safely and corrected a few typos, and smartEqual / smartDeepEqual to implement a simple = test on Arrays and Objects
- **v1.2.0**: Functions isEmpty() / isNotEmpty() now support Array and Object instead of just Strings
- **v1.1.0**: Added equal/deepEqual/notEqual/notDeepEqual functions

## Related Modules
Main modules used by amiwo are
- [merge](https://www.npmjs.com/package/merge) — Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible.
- [request-promise](https://github.com/request/request-promise) — The world-famous HTTP client "Request" now Promises/A+ compliant. Powered by Bluebird.
- [uuid](https://www.npmjs.com/package/uuid) - Simple, fast generation of RFC4122 UUIDS.

## Tests
Basic test files are in /tests. I add them each time I add a new feature (or try to :) )

## Credits

  - [Boris Gbahoue](http://github.com/bgbahoue)
  - Yvan Stern for his invaluable help and support

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2011-2015 Boris Gbahoue <[http://www.athieme_consulting.com/](http://www.athieme_consulting.com)>

