UNPKG

include-me

Version:

[![Build Status](https://travis-ci.com/Emre-Kul/include-me.svg?branch=master)](https://travis-ci.com/Emre-Kul/include-me) ![](https://img.shields.io/github/license/Emre-Kul/include-me.svg)

29 lines 818 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const fs = require("fs"); class FileManager { constructor(path) { this.file = { content: '', extension: this.getExtensionFromPath(path), name: this.getNameFromPath(path), path, }; } loadContent() { this.file.content = fs.readFileSync(this.file.path, 'utf8'); } getFile() { return this.file; } getNameFromPath(path) { const splited = path.split('/'); return splited[splited.length - 1].split('.')[0]; } getExtensionFromPath(path) { const splited = path.split('/'); return splited[splited.length - 1].split('.')[1]; } } exports.default = FileManager; //# sourceMappingURL=file-manager.js.map