web-extのreadme.mdでUsing web-ext is NodeJS codeが公開されたため、今後はそっちを使おう。
mozilla/web-extをNode.js APIから扱う。
$ npm i node-web-ext
const NodeWebExt = require('node-web-ext');
// syntax
const promise = NodeWebExt('command', {
arg: true,
fooBar: 'value'
});
// example: $ web-ext sign
const promise = NodeWebExt('sign', {
sourceDir: './src',
artifactsDir: './dist',
id: '{xxxxx-xxxxx-xxxxx-xxxxx-xxxxx}',
apiKey: 'user:00000:00000',
apiSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
}).then( (text)=>{
console.log(text);
}).catch( (error)=>{
console.error('failed')
});