How to use the buffer-json.reviver function in buffer-json

To help you get started, we’ve selected a few buffer-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jprichardson / electron-ipc-stream / src / main.js View on Github external
const ipcCallback = (event, data) => {
    if (typeof data === 'string') {
      data = JSON.parse(data, bufferJson.reviver)
    }
    this.push(data)
  }
  ipcMain.on(this.channel, ipcCallback)
github jprichardson / electron-ipc-stream / src / rend.js View on Github external
const ipcCallback = (event, data) => {
    if (typeof data === 'string') {
      data = JSON.parse(data, bufferJson.reviver)
    }
    this.push(data)
  }
  ipcRenderer.on(this.channel, ipcCallback)

buffer-json

JSON.stringify & JSON.parse which can encode/decode buffers.

MIT
Latest version published 6 years ago

Package Health Score

62 / 100
Full package analysis