@nmakarov/cli-toolkit 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/init.js CHANGED
@@ -2038,6 +2038,18 @@ var Params = class _Params {
2038
2038
  this._currentModule = prev;
2039
2039
  }
2040
2040
  }
2041
+ /**
2042
+ * Async variant of {@link runWithModule} for modules that await params.get().
2043
+ */
2044
+ async runWithModuleAsync(moduleName, fn) {
2045
+ const prev = this._currentModule;
2046
+ this._currentModule = moduleName;
2047
+ try {
2048
+ return await fn();
2049
+ } finally {
2050
+ this._currentModule = prev;
2051
+ }
2052
+ }
2041
2053
  /**
2042
2054
  * Infer module name from call stack: first caller outside params/index gives path like .../src/<moduleName>/...
2043
2055
  */