Plugin v7: Features

Protect from multiple instance

You can try to create more than a plugin, but, the plugin will protect to instantiate a lot of plugin objects. You don't need more than a one instance.

For example, in the code...

// init plugin
var plugin = new npaw.Plugin({
    'accountCode': 'powerdev',
    'user.name': 'npaw user'
})

// More customer code...

var plugin2 = new npaw.Plugin({
    'accountCode': 'powerdev',
    'user.name': 'npaw user'
})

The plugin will show you a warning, and the instance returned is the same, with the options merged...

Only a single plugin instance can be created on npaw context