ECMAScript 2015 (ES2015/ES6) [Object.assign()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) polyfill and [ponyfill](https://ponyfill.com) for ECMAScript 5 environments.
The main definition of this package has been copied from the polyfill defined in the [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign).
## Installation
### NPM
```bash
npm install es6-object-assign
```
### Manual download and import
The package is also available as a UMD module (compatible with AMD, CommonJS and exposing a global variable `ObjectAssign`) in `dist/object-assign.js` and `dist/object-assign.min.js` (833 bytes minified and gzipped).
The versions with automatic polyfilling are `dist/object-assign-auto.js` and `dist/object-assign-auto.min.js`.
## Usage
**CommonJS**:
```javascript
// Polyfill, modifying the global Object
require('es6-object-assign').polyfill();
var obj = Object.assign({}, { foo: 'bar' });
// Same version with automatic polyfilling
require('es6-object-assign/auto');
var obj = Object.assign({}, { foo: 'bar' });
// Or ponyfill, using a reference to the function without modifying globals