electron/lib/common/asar_init.js

16 lines
424 B
JavaScript

'use strict'
;(function () { // eslint-disable-line
return function (process, require, asarSource) {
const source = process.binding('natives')
// Expose fs module without asar support.
source['original-fs'] = source.fs
// Make asar.js accessible via "require".
source.ELECTRON_ASAR = asarSource
// Monkey-patch the fs module.
require('ELECTRON_ASAR').wrapFsWithAsar(require('fs'))
}
})()