jkcfg / jk

Configuration as Code with ECMAScript
https://jkcfg.github.io
Apache License 2.0
404 stars 30 forks source link

std: Introduce an Std object to carry the stdlib context #287

Closed dlespiau closed 4 years ago

dlespiau commented 4 years ago

I'd like to add state to the stdlib that persists between std.Execute() calls. I could add global variables in pkg/std or introduce an object to carry that state between Execute calls. Went for the latter.

This bit of refactoring will be very useful soon: I need to store plugin-related state because I want plugins, which are somewhat expensive to start as they are sub-processes, to be around for the duration of the Std object.