Set of JS objects to manage files using Node JS
npm install @editide/file-managementWatch the example-usage script.
You can execute it using npm run test
Otherwise, simply import it like so :
const { ServerFile, ServerFolder } = require("@editide/file-management");You can instanciate a file object using it's exact path with filePath
const rootPath = require("./rootPath"); // Returns this project root folder's path
new ServerFile({
filePath: rootPath + "LICENCE",
});or with serapate fields :
const readmeFile = new ServerFile({
folderPath: rootPath,
name: "README",
extension: "md"
});Then just add a dot to the file object and Ctrl + Space to autocomplete to see properties and methods.
It may be imperfect, but it does already helps me winning a lot of time.