Add comment about node process stdout
This commit is contained in:
@@ -1,17 +1,15 @@
|
|||||||
|
// too see stdout / stderr from this process, run
|
||||||
|
// adb logcat | grep "NODEJS-MOBILE"
|
||||||
const rnBridge = require('rn-bridge')
|
const rnBridge = require('rn-bridge')
|
||||||
try {
|
const bcryptjs = require('bcryptjs')
|
||||||
const bcryptjs = require('bcryptjs')
|
|
||||||
|
|
||||||
rnBridge.channel.on('message', (msg) => {
|
rnBridge.channel.on('message', (msg) => {
|
||||||
msg = JSON.parse(msg)
|
msg = JSON.parse(msg)
|
||||||
if (msg.type === 'request-hash') {
|
if (msg.type === 'request-hash') {
|
||||||
const hash = bcryptjs.hashSync(msg.message, 10)
|
const hash = bcryptjs.hashSync(msg.message, 10)
|
||||||
rnBridge.channel.send(JSON.stringify({
|
rnBridge.channel.send(JSON.stringify({
|
||||||
type: 'hash',
|
type: 'hash',
|
||||||
message: hash
|
message: hash
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
rnBridge.channel.send(JSON.stringify(err.message))
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user