How would I set/define the const files?

旧街凉风 提交于 2019-12-25 01:14:22

问题


How to set/ define the const files?

Have tried placing the path and CSV file location in () but does not return value.

        const searchkeywords = readKeyWords('./datain/testdata.csv','utf-8'); // database

        function readKeyWords(path) {
        return fs.readFileSync(path, 'utf-8')
            .split('\n');
    }

        async function printFiles () {
            const files = await getFilePaths();

            for (const file of files) {
                const contents = await fs.readFile(file, 'utf8');
                console.log(contents);
            }
        }

Hoping to achieve sequential iteration, serial processing.

来源:https://stackoverflow.com/questions/56484600/how-would-i-set-define-the-const-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!