How to use the asar.listPackage function in asar

To help you get started, we’ve selected a few asar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindrets / atom-title-bar-replacer / lib / window-frame-remover.js View on Github external
setTimeout(function () {
                    if (exists["app.asar.unpacked"])
                        _this.copyFolderRecursiveSync(rootPath + "app.asar.unpacked", rootPath + "app.asar.bak.unpacked");
                    _this.extractAsarAsync(rootPath + "app.asar.bak", rootPath + "_app-extract", function () {
                        _this.removeFrame(6, exists);
                    });
                    // Update info text on extraction progress until complete.
                    var total = asar.listPackage(rootPath + "app.asar.bak").length;
                    var progress;
                    var intervalId = setInterval(function () {
                        progress = _this.numFilesSync(rootPath + "_app-extract");
                        if (progress >= total)
                            clearInterval(intervalId);
                        modalDiv.setInfo("Extracted " + progress + " of " + total + ".");
                    }, 500);
                }, 50);
                break;
github anseki / vscode-color / Gruntfile.js View on Github external
asar.createPackage(`${WORK_APP_PATH}/`, WORK_ASAR_PATH, error => {
      if (error) {
        done(error);
      } else {

        const asarList = asar.listPackage(WORK_ASAR_PATH);
        fs.renameSync(WORK_ASAR_PATH, `${WORK_ASAR_PATH}_`);
        let list = filelist.getSync(WORK_VSCE_PATH)
          .reduce((list, stats) => {
            if (stats.isFile()) {
              list.push(pathUtil.relative(WORK_VSCE_PATH, stats.fullPath));
            }
            return list;
          }, []);

        fs.writeFileSync(pathUtil.join(WORK_PATH, `publish-files-${PACKAGE_JSON.version}.txt`),
          `asar l app.asar\n\n${asarList.join('\n')}\n\n` +
          `vsce ls\n\n${list.join('\n')}\n`);
        done();
      }
    });
  });
github doyensec / electronegativity / src / loader / loader_asar.js View on Github external
load(archive) {
    const archived_files = asar.listPackage(archive);
    logger.debug(`Files in ASAR archive: ${archived_files}`);

    for (const file of archived_files) {
      if(file.startsWith(`${path.sep}node_modules`)) continue;

      const f = file.startsWith(path.sep) ? file.substr(1) : file;
      switch (extension(f)) {
        case 'json':
          if (f.toLowerCase().indexOf('package.json') < 0)
            continue;
        case 'js':
        case 'jsx':
        case 'ts':
        case 'tsx':
        case 'htm':
        case 'html':

asar

Creating Electron app packages

MIT
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis