What is the odk-x javascript that would implement this code in regards to implementing the phonetics soundex and double-metaphone

Am trying to find a code that would help me implement this in the odk-x survey
Any help will highly be appreciated

const express = require(‘express’)
const app = express()
const morgan = require(‘morgan’)
const bodyParser = require(‘body-parser’)

app.use(bodyParser.urlencoded({extended: false}))

const sqlite = require(‘sqlite3’).verbose()
let db = new sqlite.Database(’./encode.db’)

let soundex = require(‘soundex-code’) //include the soundex library
let doubleMet= require(‘double-metaphone’) //include the double metaphone library

app.post(’/create’, (req, res) =>{
let gender = req.body.gender
let dob = req.body.dob
//let fname = soundex(‘req.body.fname’)
//let lname = doubleMet(‘req.body.lname’)
let fname = soundex(req.body.fname)
let lname = doubleMet(req.body.lname)
let pkv1 = gender+fname+lname[0]+dob
let pkv2 = gender+fname+lname[1]+dob

db.run("INSERT into customer(gender, dob, fname, lname, pkv1, pkv2) values('"+gender+"', '"+dob+"', '"+fname+"','"+lname+"', '"+pkv1+"','"+pkv2+"')",function(err,row){
    console.log("Entry added to table")
    res.send("New Customer has ben added")


app.get("/", (req, res)=> {
console.log(“Responding to root route”)
res.send(“Hello from Rooot”)

app.get("/users", (req, res) => {
let db = new sqlite.Database(’./encode.db’)
db.all(“SELECT * FROM customer”, (err, rows, fields) =>{
console.log(“I think the data was Fetched”)


app.listen(3003, () => {
console.log(“Server is up and listening on 3003…”)

//npm install double-metaphone

// npm install soundex-code
// npm i body-parser
// npm install sqlite3
// sudo npm i -g nodemon
// npm install express
// npm init -y
// node app.js

2 posts were merged into an existing topic: Am still stuck with implementation of double metaphone and soundex on names