crx is a utility to package Google Chrome extensions via a Node API and the command line
Packages are available to use
Compatibility: this extension is compatible with
$ npm install crx
Asynchronous functions returns an ES6 Promise.
const fs = ;const ChromeExtension = ;const crx =codebase: ""privateKey: fs});crx);
This module exports the
ChromeExtension constructor directly, which can take an optional attribute object, which is used to extend the instance.
Prepares the temporary workspace for the Chrome Extension located at
path — which is expected to directly contain
Alternatively, you can pass a list of files — the first
manifest.json file to be found will be considered as the root of the application.
Packs the Chrome Extension and resolves the promise with a Buffer containing the
Returns a Buffer containing the update.xml file used for
autoupdate, as specified for
update_url in the manifest. In this case, the instance must have a property called
const crx = ... codebase: '' ;crx;
Pack the specified directory into a .crx package, and output it to stdout. If no directory is specified, the current working directory is used.
-o option to write the signed extension to a file instead of stdout.
--zip-output option to write the unsigned extension to a file.
-p option to specify an external private key. If this is not used,
key.pem is used from within the directory. If this option is not used and no
key.pem file exists, one will be generated automatically.
-b option to specify the maximum buffer allowed to generate extension. By default, will rely on
node internal setting (~200KB).
Generate a 2048-bit RSA private key within the directory. This is called automatically if a key is not specified, and
key.pem does not exist.
--force option to overwrite an existing private key located in the same given folder.
Show information about using this utility, generated by commander.
Given the following directory structure:
└─┬ myFirstExtension├── manifest.json└── icon.png
$ cd myFirstExtension$ crx pack -o
to generate this:
├─┬ myFirstExtension│ ├── manifest.json│ ├── icon.png│ └── key.pem└── myFirstExtension.crx
You can also name the output file like this:
$ cd myFirstExtension$ crx pack -o myFirstExtension.crx
to get the same results, or also pipe to the file manually like this.
$ cd myFirstExtension$ crx pack > ../myFirstExtension.crx
As you can see a key is generated for you at
key.pem if none exists. You can also specify an external key. So if you have this:
├─┬ myFirstExtension│ ├── manifest.json│ └── icon.png└── myPrivateKey.pem
you can run this:
$ crx pack myFirstExtension -p myPrivateKey.pem -o
to sign your package without keeping the key in the directory.
Copyright (c) 2016 Jed Schmidt, Thomas Parisot and collaborators Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.