resultPromise.then(function(response) { console.info(`RESULT: ${JSON.stringify(response)}`); callback(null, { 'statusCode': 200, 'body': JSON.stringify(response) }); }).catch(function(err) { console.error(err); callback(err); });
async restoreState() { const s = await this.storageGet(null); console.info('Popup: Restoring saved state:', s); if (!s) return; if (s.selectedFolderId) this.dispatch({ type: 'SELECTED_FOLDER_SET', id: s.selectedFolderId }); }
const hooker = (order) => { const config = getConfig(); return axios.post(config.orderHook, order, { responseType: 'application/json' }) .then((response) => { if(response.status === 200){ console.info('Successfully called order hook'); } }) .catch((err) => { console.log('Error calling hook:', err); }); }
async function main() { const store = createStore(reducer, applyMiddleware(reduxMiddleware)); console.info('Popup: Init bridge and restore state...'); await bridge().init(window.browser ? window.browser : window.chrome, !!window.browser, store); console.info('Popup: Creating React app...'); ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); }
async function main() { const url = await execCommand('npm view joplin dist.tarball'); const targetPath = `${rootDir}/latest-cli.tar.gz`; await unlinkForce(targetPath); await downloadFile(url, targetPath); const sha256 = await fileSha256(targetPath); await unlinkForce(targetPath); console.info(`URL = ${url}`); console.info(`SHA256 = ${sha256}`); console.info(''); console.info(`brew update && brew bump-formula-pr --strict joplin --url=${url} --sha256=${sha256}`); }
async sendCommandToActiveTab(command) { const tabs = await this.tabsQuery({ active: true, currentWindow: true }); if (!tabs.length) { console.warn('No valid tab'); return; } this.dispatch({ type: 'CONTENT_UPLOAD', operation: null }); console.info('Sending message ', command); await this.tabsSendMessage(tabs[0].id, command); }
http.request(options, (res) => { console.info('STATUS: ' + res.statusCode); process.exitCode = (res.statusCode === 200) ? 0 : 1; process.exit(); })
prompt({ type: 'input', name: 'color', message: 'Favorite color?' }) .then(answers => { console.info(answers); process.exit(0); });
connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
async restoreState() { const s = await this.storageGet(null); console.info('Popup: Restoring saved state:', s); if (!s) return; if (s.selectedFolderId) this.dispatch({ type: 'SELECTED_FOLDER_SET', id: s.selectedFolderId }); }