Skip to content

Instantly share code, notes, and snippets.

const rl = readline.createInterface({
input: req,
// output: process.stdout
});
//
rl.on('line', (input) => {
req.pause();
addToDB(input).then(()=>{
req.resume();
});
const addToDB = async (data) => {
let arrItem;
let result;
arrItem = data.replace(/"/g, '').split(';');
if (arrItem.length === 19) {
const _id = new Types.ObjectId();
const infoObj = {
person: arrItem[0],