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