test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
mol
2023-12-14 13:24:14 +08:00
parent ea06c9fd14
commit c02d693417

View File

@ -1,5 +1,7 @@
import pkg from 'node-csv';
import logger from '#root/utils/logger.js';
import path from 'path';
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const { createParser } = pkg
let recipeData;
@ -8,7 +10,7 @@ let loaded = false;
function parser() {
const csv = createParser();
return new Promise((r, j) => {
csv.parseFile('./recipe.csv', function (err, data) {
csv.parseFile(path.join(__dirname, './recipe.csv'), function (err, data) {
if (err) {
logger.err(err);
return j();