@nfactorial/factory_node

0.0.3 • Public • Published

Build status

Linux
lin-badge

Factory

Simple module for Node.js that provides a class for creating objects by name.

This module is available using npm, to install into your own project run:

npm install --save @nfactorial/factory_node

Once installed, require it as any other module with, then create a factory with the new operator:

const Factory = require('@nfactorial/factory_node');

const myFactory = new Factory();

To use the factory, you must register your objects with your created factory instance.

const Factory = require('@nfactorial/factory_node');

const myFactory = new Factory();

myFactory.register('object_name', MyClass);

const classInstance = myFactory.create('object_name');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i @nfactorial/factory_node

Weekly Downloads

0

Version

0.0.3

License

ISC

Last publish

Collaborators

  • nfactorial