Small Housekeeping Utilities
Maid.js is a lightweight utility library providing small housekeeping functions for common tasks. Simplify your development process with easy-to-use functions for file operations, string manipulation, date and time formatting, and more.
Useful Links:
npm install @maidjs/maid-js
// Example Usage
const { fileUtils, stringUtils, dateTimeUtils, logUtils } = require('@maidjs/maid-js');
// Clean a directory
fileUtils.cleanDirectory('./exampleDirectory');
// Copy a file
fileUtils.copyFile('./exampleFile.txt', './exampleDirectory/copiedFile.txt');
// Remove whitespaces from a string
const trimmedString = stringUtils.removeWhitespace(' hello, world! ');
// Capitalize the first letter
const capitalizedString = stringUtils.capitalizeFirstLetter(trimmedString);
// Get the current timestamp
const timestamp = dateTimeUtils.getCurrentTimestamp();
// Format timestamp to date string
const dateString = dateTimeUtils.formatTimestampToDateString(timestamp);
// Log messages
logUtils.log(\`Trimmed and capitalized string: \${capitalizedString}\`);
logUtils.log(\`Current timestamp: \${timestamp}\`);
logUtils.log(\`Formatted date: \${dateString}\`);