New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

factorize

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factorize

A utility for adding Factory Pattern support to ES5+ classes.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

factorize

A utility for adding Factory Pattern support to ES5+ classes.

Installation

npm install factorize

Usage

Factorize exposes a single function which accepts a constructor function, or an ES6 class, and returns a function which can be used to create instances by using "new" or not.

var factorize = require('factorize');

Classname = factorize(Classname);

// Then to create instances you can either:
//
// Call the Classname as a function
var inst1 = Classname();

// or use the class name as a function
var inst1 = new Classname();

Note: Yes, I know this is a verb with a pre-existing meaning but I like this one.

Keywords

factory

FAQs

Package last updated on 11 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts