second
[josuexyz/.git] / node_modules / setprototypeof / README.md
1 # Polyfill for `Object.setPrototypeOf`
2
3 A simple cross platform implementation to set the prototype of an instianted object.  Supports all modern browsers and at least back to IE8.
4
5 ## Usage:
6
7 ```
8 $ npm install --save setprototypeof
9 ```
10
11 ```javascript
12 var setPrototypeOf = require('setprototypeof');
13
14 var obj = {};
15 setPrototypeOf(obj, {
16         foo: function() {
17                 return 'bar';
18         }
19 });
20 obj.foo(); // bar
21 ```
22
23 TypeScript is also supported:
24 ```typescript
25 import setPrototypeOf = require('setprototypeof');
26 ```