{"id":22216727,"url":"https://github.com/khilnani/dysf.utils","last_synced_at":"2026-04-27T12:04:07.299Z","repository":{"id":6092074,"uuid":"7319015","full_name":"khilnani/dysf.utils","owner":"khilnani","description":"Custom dysfunctional utilities for node.js !!!","archived":false,"fork":false,"pushed_at":"2018-11-23T19:45:37.000Z","size":18,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T22:05:34.612Z","etag":null,"topics":["javascript","logging","nodejs","utilities"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"bouticfactory/heroku-buildpack-go","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khilnani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-25T16:56:23.000Z","updated_at":"2023-03-08T01:44:58.000Z","dependencies_parsed_at":"2022-08-28T21:40:41.463Z","dependency_job_id":null,"html_url":"https://github.com/khilnani/dysf.utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fdysf.utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fdysf.utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fdysf.utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khilnani%2Fdysf.utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khilnani","download_url":"https://codeload.github.com/khilnani/dysf.utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245414551,"owners_count":20611367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","logging","nodejs","utilities"],"created_at":"2024-12-02T22:13:16.237Z","updated_at":"2026-04-27T12:04:07.230Z","avatar_url":"https://github.com/khilnani.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [dysf.utils [![Build Status](https://travis-ci.org/khilnani/dysf.utils.png?branch=master)](https://travis-ci.org/khilnani/dysf.utils)](#dysfutils-!build-statushttpstravis-ciorgkhilnanidysfutilspngbranch=masterhttpstravis-ciorgkhilnanidysfutils)\n- [Usage](#usage)\n- [API](#api)\n\t- [logger](#logger)\n\t- [utils](#utils)\n\t- [mock](#mock)\n- [Installation](#installation)\n\t- [Global](#global)\n\t- [Project](#project)\n\ndysf.utils [![Build Status](https://travis-ci.org/khilnani/dysf.utils.png?branch=master)](https://travis-ci.org/khilnani/dysf.utils)\n==========\n\nCustom dysfunctional utilities for node.js !!!\n\nUsage\n=========\n\n- utils - \u003ccode\u003eutils = require(\"dysf.utils\").utils;\u003c/code\u003e\n- logger - \u003ccode\u003elogger = require(\"dysf.utils\").logger;\u003c/code\u003e\n- mock - \u003ccode\u003emock = require(\"dysf.utils\").mock;\u003c/code\u003e\n\nAPI\n==========\n\nlogger\n----------\n\nA key reason for creating my own logger was to print file path and line numbers from where a log message was called.\nAdditionally it prints the date/time and also has a few additional levels of logging.\n\n- logger.setLogLevel( id ) \n  - 0: system, 1: error, 2: warn, 3: event, 4: info, 5: debug, 6: trace. Default is 4 (info)\n- logger.system ( msg | obj ) \n  - Useful for system level notifications.\n- logger.error ( msg | obj )\n- logger.warn ( msg | obj )\n- logger.event ( msg | obj )\n  - Recommended for key events like new tranactions / sessions / requests etc.\n- logger.info ( msg | obj )\n  - Recommended for notable phases within a transaction like handlers, methods etc.\n- logger.debug ( msg | obj )\n  - Recommended for useful property values or callback tracking.\n- logger.trace ( msg | obj )\n  - Recommended for detailed debugging like printing object contents.\n\nutils\n----------\n\nA random utility collection of one. Render a file to the Response \nin cases where you are not using a micro or mega framework.\n\n- utils.renderFile ( response, path, replaceParams, callback )\n  - response: Http Response\n  - path: path to file\n  - replaceParams: A hash of Ket Value pairs with the key representing the string to replace with the Value.\n  - callback: to help with callback hell.\n\nmock\n----------\n\nThe start of a few mock objects primarily useful in quick and dirty unit testing.\n\n- mock.response ( text )\n   \n\n\nInstallation\n=======\n\nGlobal\n--------- \n- Run: \u003ccode\u003esudo npm install dysf.utils -g\u003c/code\u003e\n- Usually installed at - /usr/local/lib/node_modules/dysf.utils\n\nProject\n---------\n- Add \u003ccode\u003e\"dysf.utils\": \"x.x.x\"\u003c/code\u003e to the dependencies section of your project's package.json \n  - Example \u003ccode\u003e\"dependencies\": { \"dysf.utils\": \"x.x.x\" }\u003c/code\u003e\n- Run \u003ccode\u003enpm install\u003c/code\u003e in the director with your package.json\n- Usually installed at - PROJECT_DIR/node_modules/dysf.utils\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhilnani%2Fdysf.utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhilnani%2Fdysf.utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhilnani%2Fdysf.utils/lists"}