You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
437 B
JavaScript

#!/usr/bin/env node
require('dotenv').config({path: '../.env'})
const path = require('path')
const pg = require('../db/pg')
const newDB = require('../db')
const oldDB = require('./mongo')('mongodb://localhost/sos')
const saveOrderDatafile = require('./tasks/saveOrderDatafile')
saveOrderDatafile(oldDB, path.join(__dirname, './users.json'))
.catch(console.error)
.finally(() => {
pg.end()
oldDB._connection.close()
});