txt-logger

A package which gives you an easy way to have your own logs, saved in a .txt file

Usage no npm install needed!

<script type="module">
  import txtLogger from 'https://cdn.skypack.dev/txt-logger';
</script>

README

Installation

Install it using npm :

$ npm install txt-logger

Actually not available with yarn

Getting started

Import the module in your code with the following line :

const txt-logger = require('txt-logger');

Usage

Create your own log, with the date (automatically set), the title (required) and your log (required) and the path (required) :

txt-logger.log({title : "your log's title here", log : "your log's content here", path : "path_to_your_log"}, (err) =>{
    console.log(err)
    })

Search if your log contains a value, with the path (required), and the value you want to search :

txt-logger.search({value : "the value you want to search", path : "path_to_your_log"}, (err) =>{
    console.log(err)
})