Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-mixin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-mixin - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

package.json
{
"name": "create-mixin",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "2.0.0",
"version": "2.0.1",
"description": "Creates a mixin for use in a class extends expression",

@@ -26,7 +26,5 @@ "repository": "https://github.com/75lb/create-mixin.git",

"test": "test-runner test.js",
"docs": "jsdoc2md --template README.hbs dist/index.js > README.md",
"dist": "rollup -c dist/index.config.js"
},
"devDependencies": {
"jsdoc-to-markdown": "^5.0.0",
"rollup": "^1.12.4",

@@ -33,0 +31,0 @@ "test-runner": "^0.6.0"

@@ -9,4 +9,16 @@ [![view on npm](https://img.shields.io/npm/v/create-mixin.svg)](https://www.npmjs.org/package/create-mixin)

Useful for achieving something resembling multiple-inheritence in Javascript.
```js
const mixInto = require('create-mixin')
const EventEmitter = require('events')
class EmittingArray extends mixInto(EventEmitter)(Array) {}
```
## Example
Given these two classes.
```js

@@ -66,19 +78,4 @@ class Base {

<a name="module_create-mixin"></a>
## create-mixin
Creates a mixin for use in a class extends expression.
<a name="exp_module_create-mixin--createMixin"></a>
### createMixin(Src) ⇒ <code>function</code> ⏏
**Kind**: Exported function
| Param | Type | Description |
| --- | --- | --- |
| Src | <code>class</code> | The class containing the behaviour you wish to mix into another class. |
* * *
&copy; 2018-19 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
&copy; 2018-19 Lloyd Brookes \<75pound@gmail.com\>.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc