INNER CODE UNIT · TypeScript

ON_DEATH

open-wa/wa-automate-nodejs · demo/index.ts:9

const ON_DEATH = fn => process.on("exit",fn) 
let globalClient:Client;
const express = require('express')

const app = express()
app.use(express.json({limit: '200mb'})) //add the limit option so we can send base64 data through the api

const PORT = 8082;


ON_DEATH(async function() {
  console.log('killing session');
  if(globalClient)await globalClient.kill();
})

/**
 * Detect the qr code
 */

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…