aboutsummaryrefslogtreecommitdiff
path: root/Functions/open.js
blob: f04201b86ad6d643b834b4d1b6c75eb86628cef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const fs = require("fs");

function openFile(path)
{
	return new Promise((resolve, reject) =>
	{
		fs.readFile(path, (err, data) =>
		{
			if (err)
				reject(err);
			resolve(data);
		})
	});
}

exports.file = openFile;