crx(['/path/to/manifest.json', '/path/to/**.js', '!/path/to/node_modules'], { options })
.then(crx => {
crx.options; // { options }
crx.included; // => ['manifest.json', 'index.js'];
crx.excluded; // => ['node_modules/jquery/dist/jquery.js', ...]
crx.mapping; // => { '/path/to/manifest.json' => 'manifest.json', ... }
crx.archive()
.then(archive => archive.pipe(fs.createWriteFile('extension.zip')))
.then(archive => crx.sign(archive))
.then(stream => stream.pipe(fs.createWriteFile('extension.crx')));
});
API
Under the hood we need to have:
Are dropped:
Options
ignore (defaults to ['*.pem', '.git', '*.crx'])
publicKey
privateKey (optional, to use #sign() only)
autoupdate
API
crx(files, options)file selection constructorpack().then(archive)sign(archive).then(crx)getManifest(appId)Under the hood we need to have:
generateAppId(publicKey).then(appId)generateSignature(archive).then(signature)Are dropped:
writeFileloadoptions.rootDirectory,options.pathandoptions.srcOptions
ignore(defaults to['*.pem', '.git', '*.crx'])publicKeyprivateKey(optional, to use#sign()only)autoupdatecodebaseprodversionmin