Rem supports users work, like a maid.
If the input is google レム --images
, it is parsed by yargs-parser
and config.google.exec
is executed with querys = ['レム']
and options = { images: true }
.
e.g.) index.js
const open = require('open');
const Rem = require('../');
new Rem({
google: {
description: 'Search Google for ${querys[0]}',
minQuerysLength: 1,
exec: (querys, options) => {
if (options.hasOwnProperty('images')) {
open(`https://www.google.co.jp/search?q=${querys[0]}&tbm=isch`);
} else {
open(`https://www.google.co.jp/search?q=${querys[0]}`);
}
}
}
});