0.1.0 • Published 7 years ago

z-global v0.1.0

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
7 years ago

z-global

Temporarily set global variables.

Installation

Using npm:

npm install --save z-global

Use

Example usage:

const env = require('z-global')

compileNodes(view, core, user) {
    // Add global variables:
    env.setGlobal('functions', core.functions)
    env.setGlobals(user.functions)

    // Import a module that uses those global variables:
    const nodes = require(view)

    // Remove the previously added global variables:
    env.revertGlobals()

    return nodes
}
0.1.0

7 years ago