1.1.2 • Published 3 years ago

easyfilehandler.js v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

easyfilehandler.js

DOCUMENTATION(https://filehandling.netlify.app/docs.html)

Whats New?

We have made documentation for this package. We have also added JsonHandler which works like FileHandler but only for JSON files, learn more Here

Why use easyfilehandler.js?

You should use easyfilehandler.js because it is object oriented. easyfilehandler.js also used ES6 way of importing, the best feature about this package is it does everything for you. I know you hate writing fs.writeFile and other funcations again and again.

Is this package open source?

*The answer is ....yes! You can contribute Here

Do you guys have package for python

Yes we have a package for python Here

How to use easyfilehandler.js?

npm install easyfilehandler.js

File Reading

How do I read file synchronously?

import FileHandler from 'easyfilehandler.js';

const myFileHandler = new FileHandler("test.txt") // or enter path

console.log(myFileHandler.readFileSync())

How do I read file asynchronously?

import FileHandler from 'easyfilehandler.js';

const myFileHandler = new FileHandler("test.txt"); // or enter path

myFileHandler.readFileSync((data) => {
    console.log(data);
})

File Writing

How do I write file synchronously?

import FileHandler from 'easyfilehandler.js';

const myFileHandler = new FileHandler("test.txt"); // or enter path

const randomCoolData = "Hello I'm data I'm supposed to be in a database but I'm not LOLO LOL";

myFileHandler.writeToFileSync(randomCoolData); // require param data

How do I write file asynchronously?

import FileHandler from 'easyfilehandler.js';

const myFileHandler = new FileHandler("test.txt"); // or enter path

const randomCoolData = "Hello I'm data I'm supposed to be in a database but I'm not LOLO LOL";

myFileHandler.writeToFileAsync(randomCoolData); // require param data