Skip to content

Theblockbuster1/fs-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fs-logger

NPM version node-current NPM downloads npm bundle size install size

Appends text to a file. Simple. 0 dependencies.

Based of fs.

Installation

Just run npm i fs-logger.js in console.

Usage

First import the module:

const log = require('fs-logger.js');

log()

(async function(){
    await log('log.txt', 'hello world');
    console.log('done!');
})();

log.txt:

hello world

log.sync()

log.sync('log.txt', 'hello world');
console.log('done!');

log.txt:

hello world
hello world