paularmstrong/swig — Issue #44: Allow 3rd party library access from within compiled templates
Author: paularmstrong
Created: 2012-02-07 02:57:29+00:00
State: open
Labels: Feature

## Scenario

Implementing a custom tag, a person may want to be able to access a third-party library from within compiled swig templates. Currently this is not possible due to the way the templates are compiled an executed.

## Example

@Tatort79 wants to create a custom tag for [i18next](https://github.com/jamuhl/i18next-node), but access to that library is restricted from compiled templates.

## Solution

Allow the ability to register third-party dependencies via `swig.init` and allow them to be callable into the render method. See lines [#71](https://github.com/paularmstrong/swig/blob/master/index.js#L71), [#91](https://github.com/paularmstrong/swig/blob/master/index.js#L91), and [#94](https://github.com/paularmstrong/swig/blob/master/index.js#L94)