Skip to content

FalloutStudios/fallout-utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fallout-utility

npm i fallout-utility
yarn add fallout-utility
pnpm add fallout-utility

Quick start

CommonJs
const util = require("fallout-utility");
ES Modules
import utils from "fallout-utility";

Logger Usage

import { Logger } from 'fallout-utility/Logger';

const logger = new Logger();

// Log to file
await logger.createFileWriteStream({
    file: './logs/latest.log'
});

// Logs like console.log but also puts content to a file
logger.log('Fallout util');

// Other log methods
logger.warn(`Warning!`); // alias for logger.warning
logger.warning(`Warning!`);

logger.err(`Error!`); // alias for logger.error
logger.error(`Error!`);

logger.debug(`Debug!`); // Logs messages only on debug mode