{"id":19219633,"url":"https://github.com/squirrel-forge/node-util","last_synced_at":"2026-05-17T03:04:13.612Z","repository":{"id":57162146,"uuid":"430109258","full_name":"squirrel-forge/node-util","owner":"squirrel-forge","description":"Collection of basic node utilities, errors, terminal input, output, filesystem and more.","archived":false,"fork":false,"pushed_at":"2022-10-31T23:35:22.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T21:23:55.855Z","etag":null,"topics":["cli","input","node","nodejs","output","utilities"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squirrel-forge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-11-20T13:23:09.000Z","updated_at":"2024-03-13T23:56:24.000Z","dependencies_parsed_at":"2023-01-21T03:03:20.343Z","dependency_job_id":null,"html_url":"https://github.com/squirrel-forge/node-util","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fnode-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squirrel-forge","download_url":"https://codeload.github.com/squirrel-forge/node-util/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240292392,"owners_count":19778311,"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":["cli","input","node","nodejs","output","utilities"],"created_at":"2024-11-09T14:32:19.285Z","updated_at":"2026-05-17T03:04:13.563Z","avatar_url":"https://github.com/squirrel-forge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @squirrel-forge/node-util\nCollection of basic node utilities, errors, terminal input, output, filesystem and more.\n\n## Installation\n```\nnpm i @squirrel-forge/node-util\n```\n\n## Usage\n```\nconst { Class, function } = require( '@squirrel-forge/node-util' );\n```\n\n## Notes\nIn prepareation of node version support changes, dependencies are softened and must be specified and/or documented by packages requiring them.\n[**Breaking changes**] since version *^1.4.0* all external dependencies were removed and made optional peer dependencies and therefore must be installed manually when required.\n\n### Optional dependencies\nThese dependencies are optional and only required when using the mentioned methods or classes.\nAll of these must be installed manually, since they have been removed as direct dependencies.\n\n - [cli-spinner@^0.2.x](https://www.npmjs.com/package/cli-spinner/v/0.2.10)\n   - *Progress*\n - [directory-tree@^3.x](https://www.npmjs.com/package/directory-tree/v/3.3.0)\n   - *FsInterface.fileList*\n - [intercept-stdout@^0.1.x](https://www.npmjs.com/package/intercept-stdout/v/0.1.2)\n   - *OutputBuffer*\n   - *Progress*\n - [node-fetch@^2.x](https://www.npmjs.com/package/node-fetch/v/2.6.7) for *node 10.x*, use *node-fetch@^3.x* for later node versions. \n   - *FsInterface.remote*\n   - *FsInterface.remoteText*\n   - *FsInterface.remoteJSON*\n - [semver@^6.x](https://www.npmjs.com/package/semver/v/6.3.0) for *node 10.x*, use *semver@^7.x* for later node versions.\n   - *updateNotice*\n\n### Classes\n - CliInput( cfx, args, trimQuotes, false, true )\n   - trimQuotes : boolean \n   - hasArgs()\n   - hasFlags()\n   - flag( flag, default )\n   - arg( index )\n   - setArg( arg )\n   - setFlag( flag )\n   - getFlagsOptions( src )\n   - eraseLastLine()\n   - question( options )\n   - ask( questions )\n - Exception( message, previous, options )\n   - name : string\n   - previous : *\n   - stack : string\n   - toString()\n - FsInterface : static\n   - remote( url )*\n   - remoteText( url )*\n   - remoteJSON( url )*\n   - read( file, enc )\n   - readText( file )\n   - readJSON( file )\n   - exists( file, access )\n   - write( file, content )\n   - copy( source, target )\n   - dir( dir )\n   - isDir( dir )\n   - unlink( file )\n   - relative2root( dir, root )\n   - filterOptions( options )\n   - filterFiles( files, options )\n   - files( dir, filter )\n   - fileList( dir, options )*\n   - fileListRecursive2Flat( tree, result )\n   - treeWalker( tree, callback )\n - OutputBuffer()*\n   - length : number\n   - allowIntercept : boolean\n   - flush()\n   - reduce()\n   - contents()\n   - start()\n   - end()\n   - onIntercept( handler )\n   - offIntercept( handler )\n - Progress()*\n   - start( text, loop, safemode )\n   - stop( keep )\n - StatsDisplay( cfx )\n   - constructor\n     - StatsDisplayException : StatsDisplayException constructor\n     - StatsDisplayType : StatsDisplayType constructor\n   - hasStyle( name )\n   - styleAs( string, style, no-reset )\n   - is_simple( value )\n   - is_display_type( value )\n   - show( value, result, level, heading )\n   - parse( source, result )\n   - display( source, output )\n - Timer\n   - start( name )\n   - get( name )\n   - measure( name )\n   - end( name )\n - Warning( message, previous, options ) extends Exception\n   - name : string\n   - previous : *\n   - stack : string\n   - toString()\n   - toLocaleString()\n\n### Functions\n - callback( name, context, args )\n - cmd( command )\n - convertBytes( bytes, decimals, style, return, unit )\n - convertHrtime( time, seconds_suffix_separrator, milliseconds_suffix, return )\n - isPojo( obj )\n - isUrl( string )\n - leadingZeros( number, length, char, reverse )\n - parseInput( args )\n - prompt( once )\n - rand( min, max )\n - requireOptional( name, version, fatal )\n - round( value, decimals )\n - simpleReplace( template, data, prefix, suffix )\n - strand()\n - strSlug( string )\n - trimChar( string, remove, limit )\n - updateNotice( pkg, cfx, verbose )\n - wait( ms )\n\n* Has dependency, see [optional dependencies](#optional-dependencies).\n\n## Issues and docs\nIf you encounter any issues, please report [here](https://github.com/squirrel-forge/node-util/issues).\n\n---\nCheck the sourcecode on [github](https://github.com/squirrel-forge/node-util) for detailed comments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fnode-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquirrel-forge%2Fnode-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fnode-util/lists"}