npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mnm-node-utilities

v1.7.1

Published

My personalize node utilities for creating node applications

Readme

MNM-NODE-UTILITIES

MNM-NODE-UTILITIES is a modular, lightweight, and practical Node.js utilities library that provides a wide range of helper functions for:

  • Date & time handling\
  • File system operations\
  • JSON processing\
  • Node process utilities\
  • Object & array manipulation\
  • String manipulation\
  • URL/query-string utilities\
  • Web-page scripting helpers\
  • Web-request utilities\
  • Geo & timezone lookup\ requires playwright
  • Miscellaneous helpers\
  • Factory constructors for Node processes and EventEmitters

This library is designed to be a powerful toolbox for Node.js applications, automation scripts, web scraping projects, CLI tools, and backend services.

As of now, please bear with the fact that I don't have all the definitions and usage examples for all the functions, and I promise to work on each of them when I have the time to do it -- but most of their functionalities should be explicit enough from their function names alone.


📦 Installation

Install via npm

npm install mnm-node-utilities

Install via GitHub

npm install mmichaelnorward777/mnm-node-utilities

📚 Usage

const { getFormattedDateStr, getNumberOfDaysOfMonth, objectToDotNotation, dotNotationToObject } = require("mnm-node-utilities");

// Example
const date = getFormattedDateStr(new Date());
console.log(date); // sample result would be 'January 5, 2025'

let dt = new Date(),
    numberOfDaysOfMonth = getNumberOfDaysOfMonth(dt);
console.log(numberOfDaysOfMonth) // 28 || 29 || 30 || 31 depending on the current month of the date object

// objectToDotNotation - good for using objects as query params and converting nested objects into dot notation, which works with mongoose

let person = {
        firstName : "John",
        lastName : "Doe",
        familyMembers : {
            spouse : {
                firstName : "Jane",
                lastName : "Doe",
            },
            son : {
                firstName : "George",
                lastName : "Doe"
            }
        }
    },
    dotNotatedPerson = objectToDotNotation(person);

    console.log(dotNotatedPerson); 

    /* 
        this would log: 

        {
            firstName : "John",
            lastName : "Doe",
            familyMembers.spuse.firstName : "Jane",
            familyMembers.spuse.lastName : "Doe",
            familyMembers.son.lastName : "George",
            familyMembers.spuse.lastName : "Doe",
        }
    
    */

// we can also revert dot notated objects back to its original form (nested objects);

let revertedObject = dotNotationToObject(dotNotatedPerson);

console.log(revertedObject);

/* 
    this would log:
    {
        firstName : "John",
        lastName : "Doe",
        familyMembers : {
            spouse : {
                firstName : "Jane",
                lastName : "Doe",
            },
            son : {
                firstName : "George",
                lastName : "Doe"
            }
        }
    }
*/



Utilities are grouped logically by category for easier navigation.


📖 Available Functions

Below is the full list of exposed functions currently available in the package.

Detailed usage documentation will be added over time.
For now, this serves as a complete reference list of what you can import and use.


🗓️ Date Functions

  • formattedDate
  • getFormattedTime
  • dateTimeObject
  • getTimeElapsed
  • createZuluStartDate
  • getOffsetMinutesForTimezone
  • toISOZeroOffset
  • getHourlyDuration
  • getDurationInMinutes
  • localDateToSelectedTimeZone
  • getCurrentMonthByIndex
  • getNextMonth
  • getPrevMonth
  • getNumberOfDaysOfMonth
  • getIsoFormattedTime
  • getISOFormattedDate
  • getFormattedDateStr
  • fixTimeStr
  • createTzScheduleObject
  • checkDateFlow
  • getForwardDateRangeObjects
  • getBackwardDateRangeObjects
  • getDateRangeObjects
  • getDateRangeObjectsWithIsoZeroOffset

📁 File System Functions

  • baseName\
  • fileExists\
  • isFile\
  • isDirectory\
  • getFileExt\
  • getParentDir\
  • readdir\
  • readdirSync\
  • mkdir\
  • mkdirSync\
  • deleteDir\
  • deleteDirSync\
  • readFile\
  • readFileSync\
  • writeFile\
  • writeFileSync\
  • deleteFile\
  • deleteFileSync\
  • isFileEmpty\
  • isFileEmptySync\
  • isDirectoryEmpty\
  • isDirectoryEmptySync\
  • getAllFilesFromDirectory\
  • getAllFilesFromDirectorySync\
  • getAllDirsFromDirectory\
  • getAllDirsFromDirectorySync\
  • getFileObject\
  • getAllFilesRecursively\
  • getAllFilesRecursivelySync\
  • deleteAllFilesInDirPath\
  • deleteAllDirsInDirPath\
  • deleteAllInDirPath\
  • deleteAllEmptyFilesInDirectory\
  • deleteAllEmptyDirsInDirectory\
  • getMimeType\
  • getFileExtensionsByMimeType\
  • getSpecifiedExt\
  • getFileSize\
  • createSvgFile\
  • createDirPath\
  • getAppDataDirPath

🧾 JSON Functions

  • createJsonFileObject\
  • parseValidatedJSON

⚙️ Node-Related Functions

  • spawnOnChildProcess\
  • getRequestResult\
  • createNodeModule\
  • sendDataToMainProcess\
  • getAppDataDirPath

🧩 Object & Array Functions

  • getValidatedPropValues\
  • isObjectInArray\
  • getAllObjectKeys\
  • sortObjectsByDate\
  • objectToString\
  • isObjectUnique\
  • filterUnlistedObjects\
  • shuffleArr\
  • sortObjectsByPropName\
  • objectCompare\
  • assignProps\
  • deepObjectAssignment

🔡 String Functions

  • toUrl\
  • toCapitalize\
  • toCapitalizeAll\
  • toNormalString\
  • getInitials\
  • toCamelCase

🌐 URL Functions

  • urlConstructor\
  • objectToQueryString\
  • urlToQueryStringObject\
  • objectToDotNotation\
  • dotNotationToObject\
  • queryStringToObject\
  • getDomain\
  • cleanApiUrl\
  • checkSubDomain

🖥️ Web-Page Related Functions

  • xhrDetector\
  • scrollToBottom\
  • scrollToBottomByCondition\
  • scrollToElement\
  • scrollToTop\
  • toggleScroll\
  • waitForSelector\
  • typeIt\
  • createJSONBlob\
  • downloadJsonFile\
  • downloadAllJsonFiles\
  • downloadCsvData\
  • readBlobData\
  • zipData\
  • timedReload\
  • detectDOMChanges

🌐 Web-Requests Functions

  • apiRequest\
  • postDataObjects\
  • verifyUrl\
  • dynamicApiRequest\
  • getRequestResult

🔧 Miscellaneous Functions

  • filterObjectsByMethodName\
  • dynamicRequire\
  • slowDown\
  • getAllCombination\
  • rgb2hex\
  • pxToPt\
  • encodeURILowerCasedSpecialChars

🗺️ Geo-Timezone Functions

  • getCoords\
  • geoTzLookUp\
  • getGeoTzObject\
  • mapAddressLookup

⚡ Process & EventEmitter Utilities

nodeProcess: {
    classConstructor: ProcessClass,
    classFactory: processClassFactory,
},

nodeEvent: {
    classConstructor: EventClass
}

🤝 Contribution

Contributions, improvements, and expanded documentation are welcome.

  1. Fork the repository\
  2. Create a feature branch\
  3. Submit a Pull Request

📄 License

MIT License --- free to use, modify, and distribute.