@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.cjs CHANGED
@@ -2063,6 +2063,18 @@ var Params = class _Params {
2063
2063
  this._currentModule = prev;
2064
2064
  }
2065
2065
  }
2066
+ /**
2067
+ * Async variant of {@link runWithModule} for modules that await params.get().
2068
+ */
2069
+ async runWithModuleAsync(moduleName, fn) {
2070
+ const prev = this._currentModule;
2071
+ this._currentModule = moduleName;
2072
+ try {
2073
+ return await fn();
2074
+ } finally {
2075
+ this._currentModule = prev;
2076
+ }
2077
+ }
2066
2078
  /**
2067
2079
  * Infer module name from call stack: first caller outside params/index gives path like .../src/<moduleName>/...
2068
2080
  */