ocat-lang
Version:
A programming language for the web design and development
32 lines (29 loc) • 667 B
text/typescript
import * as fs from "fs";
export const readFile = (
_path: string,
uglify: boolean = false
): string | null => {
try {
const data = fs.readFileSync(_path, "utf8");
if (uglify) {
return data.replace(/\s+/g, "");
}
return data;
} catch (e) {
return null;
}
};
export const readFileWP = (
path: string,
uglify: boolean = false
): string | null => {
try {
const data = fs.readFileSync(path, "utf8");
if (uglify) {
return data.replace(/\s+/g, "");
}
return data;
} catch (e) {
return null;
}
};