CoolFace
Apppublic

opusdev/vector-similarity-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
README.md43 linesDownload Raw Back to inherits
1Browser-friendly inheritance fully compatible with standard node.js2[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).3 4This package exports standard `inherits` from node.js `util` module in5node environment, but also provides alternative browser-friendly6implementation through [browser7field](https://gist.github.com/shtylman/4339901). Alternative8implementation is a literal copy of standard one located in standalone9module to avoid requiring of `util`. It also has a shim for old10browsers with no `Object.create` support.11 12While keeping you sure you are using standard `inherits`13implementation in node.js environment, it allows bundlers such as14[browserify](https://github.com/substack/node-browserify) to not15include full `util` package to your client code if all you need is16just `inherits` function. It worth, because browser shim for `util`17package is large and `inherits` is often the single function you need18from it.19 20It's recommended to use this package instead of21`require('util').inherits` for any code that has chances to be used22not only in node.js but in browser too.23 24## usage25 26```js27var inherits = require('inherits');28// then use exactly as the standard one29```30 31## note on version ~1.032 33Version ~1.0 had completely different motivation and is not compatible34neither with 2.0 nor with standard node.js `inherits`.35 36If you are using version ~1.0 and planning to switch to ~2.0, be37careful:38 39* new version uses `super_` instead of `super` for referencing40  superclass41* new version overwrites current prototype while old one preserves any42  existing fields on it43