Skip to content

( JS package - Nodejs ) node files is node promise based that provide easy way dealing with file system

License

Notifications You must be signed in to change notification settings

hosam1696/n-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-files

node files is node promise based that provide easy way dealing with files

  • open your directory and install node-files as dependency
npm i n-files
  • import the module
const nfs = require('n-files');
//or 
const {read} = require('n-files');

Example

(async function x() {
        let file = await nfs.read('./LICENSE');
        let files = await nf.filesInDir();
        // loop on every single line of the file 
        for (let line of file.lines())
            if(line.startsWith('Copyright')) 
                console.log(line); // Copyright (c) 2017 Hosam Elnabawy
        console.log(file.count);   // 17
        console.log(files.map(file =>extname(file)||file)); // [ '.gitignore', '.js', 'LICENSE', '.json', '.md', '.js' ]

});

About

( JS package - Nodejs ) node files is node promise based that provide easy way dealing with file system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published