{"id":23613764,"url":"https://github.com/jdevera/jdvlib.sh","last_synced_at":"2025-11-06T10:30:45.019Z","repository":{"id":269175828,"uuid":"828685061","full_name":"jdevera/jdvlib.sh","owner":"jdevera","description":"Jacobo de Vera's Bash Library","archived":false,"fork":false,"pushed_at":"2024-12-21T13:42:45.000Z","size":98,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-21T14:32:43.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdevera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-14T22:22:07.000Z","updated_at":"2024-12-21T13:42:49.000Z","dependencies_parsed_at":"2024-12-21T14:33:17.864Z","dependency_job_id":"1d783714-bf22-400e-9a48-6964fe35a841","html_url":"https://github.com/jdevera/jdvlib.sh","commit_stats":null,"previous_names":["jdevera/jdvlib.sh"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdevera%2Fjdvlib.sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdevera%2Fjdvlib.sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdevera%2Fjdvlib.sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdevera%2Fjdvlib.sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdevera","download_url":"https://codeload.github.com/jdevera/jdvlib.sh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239492894,"owners_count":19647994,"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":[],"created_at":"2024-12-27T17:28:36.490Z","updated_at":"2025-11-06T10:30:44.945Z","avatar_url":"https://github.com/jdevera.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jdvlib.sh: Jacobo de Vera's Bash Library\n\n\u003e Look, you don't have to like it.\n\n## How to use\n\nRun `make` to bundle the library into a single file\n`build/jdvlib.sh`.\n\nCopy that file to your project and source it in your scripts.\n\n```bash\n# shellcheck source=./jdvlib.sh\nsource \"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" \u0026\u003e /dev/null \u0026\u0026 pwd )/jdvlib.sh\"\n```\n\n## Configuration\n\nThese variables affect the behaviour:\n\n* `JDVLIB_DEBUG`: Set to `true` to enable debug output. There is not a lot of this, though.\n    * Deprecation messages will include file and line of the caller.\n* `JDVLIB_LOG_DEPRECATIONS`: Set to *something* to log deprecation messages to `~/.jdvlib-deprecations.log`.\n\n\n## Modules\n\n\u003c!-- MODULES:START --\u003e\n### Module `_meta`\n\nFunctions that support the library.\nThis module is the basis for imports, so there should never be an import of this file.\n\n#### Functions\n\n- `meta::for_each_library_module`\n- `meta::import`\n- `meta::is_compiling`\n- `meta::lib_is_compiled`\n- `meta::library_path`\n- `meta::module_is_running`\n\n### Module `ansi`\n\nFunctions related to ANSI escape codes. This code is vendored in from\n[Tyler Akins' ansi project](https://github.com/fidian/ansi).\n\n#### Functions\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand (118 functions)\u003c/summary\u003e\n\n- `ansi::ansi`\n- `ansi::backward`\n- `ansi::bell`\n- `ansi::bgBlack`\n- `ansi::bgBlackIntense`\n- `ansi::bgBlue`\n- `ansi::bgBlueIntense`\n- `ansi::bgColor`\n- `ansi::bgCyan`\n- `ansi::bgCyanIntense`\n- `ansi::bgGreen`\n- `ansi::bgGreenIntense`\n- `ansi::bgMagenta`\n- `ansi::bgMagentaIntense`\n- `ansi::bgRed`\n- `ansi::bgRedIntense`\n- `ansi::bgRgb`\n- `ansi::bgWhite`\n- `ansi::bgWhiteIntense`\n- `ansi::bgYellow`\n- `ansi::bgYellowIntense`\n- `ansi::black`\n- `ansi::blackIntense`\n- `ansi::blink`\n- `ansi::blue`\n- `ansi::blueIntense`\n- `ansi::bold`\n- `ansi::color`\n- `ansi::colorCodePatch`\n- `ansi::colorCodes`\n- `ansi::colorTable`\n- `ansi::colorTableLine`\n- `ansi::column`\n- `ansi::columnRelative`\n- `ansi::cyan`\n- `ansi::cyanIntense`\n- `ansi::deleteChars`\n- `ansi::deleteLines`\n- `ansi::doubleUnderline`\n- `ansi::down`\n- `ansi::encircle`\n- `ansi::eraseChars`\n- `ansi::eraseDisplay`\n- `ansi::eraseLine`\n- `ansi::faint`\n- `ansi::font`\n- `ansi::forward`\n- `ansi::fraktur`\n- `ansi::frame`\n- `ansi::green`\n- `ansi::greenIntense`\n- `ansi::hideCursor`\n- `ansi::icon`\n- `ansi::ideogramLeft`\n- `ansi::ideogramLeftDouble`\n- `ansi::ideogramRight`\n- `ansi::ideogramRightDouble`\n- `ansi::ideogramStress`\n- `ansi::insertChars`\n- `ansi::insertLines`\n- `ansi::inverse`\n- `ansi::invisible`\n- `ansi::isAnsiSupported`\n- `ansi::italic`\n- `ansi::line`\n- `ansi::lineRelative`\n- `ansi::magenta`\n- `ansi::magentaIntense`\n- `ansi::nextLine`\n- `ansi::noBlink`\n- `ansi::noBorder`\n- `ansi::noInverse`\n- `ansi::noOverline`\n- `ansi::noStrike`\n- `ansi::noUnderline`\n- `ansi::normal`\n- `ansi::overline`\n- `ansi::plain`\n- `ansi::position`\n- `ansi::previousLine`\n- `ansi::rapidBlink`\n- `ansi::red`\n- `ansi::redIntense`\n- `ansi::repeat`\n- `ansi::report`\n- `ansi::reportIcon`\n- `ansi::reportPosition`\n- `ansi::reportScreenChars`\n- `ansi::reportTitle`\n- `ansi::reportWindowChars`\n- `ansi::reportWindowPixels`\n- `ansi::reportWindowPosition`\n- `ansi::reportWindowState`\n- `ansi::reset`\n- `ansi::resetAttributes`\n- `ansi::resetBackground`\n- `ansi::resetColor`\n- `ansi::resetFont`\n- `ansi::resetForeground`\n- `ansi::resetIdeogram`\n- `ansi::restoreCursor`\n- `ansi::rgb`\n- `ansi::saveCursor`\n- `ansi::scrollDown`\n- `ansi::scrollUp`\n- `ansi::showCursor`\n- `ansi::showHelp`\n- `ansi::strike`\n- `ansi::tabBackward`\n- `ansi::tabForward`\n- `ansi::title`\n- `ansi::underline`\n- `ansi::up`\n- `ansi::visible`\n- `ansi::white`\n- `ansi::whiteIntense`\n- `ansi::yellow`\n- `ansi::yellowIntense`\n\n\u003c/details\u003e\n\n### Module `args`\n\nFunctions to help with parsing and validation of command line arguments.\n\n#### Functions\n\n- `args::check_help_arg`\n- `args::ensure_num_args`\n- `args::ensure_num_args_between`\n- `args::flag_value`\n- `args::get_flag_value`\n\n### Module `code`\n\nFunctions that relate to the code itself, where it is located, and how it is used.\n\n#### Functions\n\n- `code::is_sourced`\n- `code::script_dir`\n\n### Module `compat`\n\nThis is a compatibility layer for deprecated functions.  It is intended to be\nused when refactoring code to use the new functions.  It will be removed in the\nfuture.\n\n#### Functions\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand (38 functions)\u003c/summary\u003e\n\n- `ask`\n- `can_user_write_to_dir`\n- `check_help_arg`\n- `deco_message`\n- `die`\n- `dotenv_delete`\n- `dotenv_load`\n- `dotenv_save`\n- `echo_step`\n- `ensure_debian`\n- `ensure_dir_exists`\n- `ensure_docker_host`\n- `ensure_file_exists`\n- `ensure_has_commands`\n- `ensure_in_path`\n- `ensure_in_remote_mount`\n- `ensure_num_args`\n- `ensure_pve`\n- `ensure_root`\n- `ensure_var_is_set`\n- `fail`\n- `flag_value`\n- `get_arch`\n- `get_os`\n- `has_command`\n- `info`\n- `is_in_remote_mount`\n- `is_linux`\n- `is_lxc`\n- `is_macos`\n- `is_owned_by_user`\n- `load_env`\n- `noop`\n- `ok`\n- `print_aligned`\n- `replace_between_markers`\n- `run_as`\n- `script_dir`\n\n\u003c/details\u003e\n\n### Module `env`\n\nFunctions used to manage environment variables.\n\n#### Functions\n\n- `env::dotenv_delete`\n- `env::dotenv_load`\n- `env::dotenv_save`\n- `env::ensure_is_set`\n\n### Module `fs`\n\nFunctions related to the filesystem. Existance, permissions, etc.\n\n#### Functions\n\n- `fs::can_user_write_to_dir`\n- `fs::ensure_dir_exists`\n- `fs::ensure_file_exists`\n- `fs::ensure_in_remote_mount`\n- `fs::is_in_remote_mount`\n- `fs::is_owned_by_user`\n\n### Module `func`\n\nFunctions related to functions and function management.\n\n#### Functions\n\n- `func::ensure`\n- `func::list_functions_in_file`\n\n### Module `pve`\n\nFunctions related to Proxmox Virtual Environment (PVE).\n\n#### Functions\n\n- `pve::ensure_lxc`\n- `pve::ensure_pve`\n- `pve::is_lxc`\n- `pve::is_pve`\n\n### Module `sys`\n\nFunctions related to the system, its attributes and capabilities.\n\n#### Functions\n\n- `sys::ensure_debian`\n- `sys::ensure_docker_host`\n- `sys::ensure_has_commands`\n- `sys::ensure_in_path`\n- `sys::ensure_linux`\n- `sys::ensure_macos`\n- `sys::get_arch`\n- `sys::get_os`\n- `sys::has_command`\n- `sys::is_debian`\n- `sys::is_docker_host`\n- `sys::is_in_path`\n- `sys::is_linux`\n- `sys::is_macos`\n- `sys::run_as`\n\n### Module `text`\n\nFunctions that relate to text manipulation.\n\n#### Functions\n\n- `text::apply_in_place`\n- `text::comment_out_inside_markers`\n- `text::delete_around_markers`\n- `text::delete_inside_markers`\n- `text::filter_inside_markers`\n- `text::format_inside_markers`\n- `text::print_aligned`\n- `text::read_inside_markers`\n- `text::replace_between_markers_legacy`\n- `text::replace_inside_markers`\n\n### Module `ui`\n\nFunctions to interact with the user.\n\n#### Functions\n\n- `ui::ask`\n- `ui::deco_message`\n- `ui::deprecate`\n- `ui::die`\n- `ui::echo_step`\n- `ui::fail`\n- `ui::info`\n- `ui::noop`\n- `ui::ok`\n- `ui::reassurance_required`\n- `ui::reassure`\n\n### Module `user`\n\nFunctions related to users and groups.\n\n#### Functions\n\n- `user::add_to_groups`\n- `user::create`\n- `user::ensure_exists`\n- `user::ensure_group_exists`\n- `user::ensure_in_group`\n- `user::ensure_root`\n- `user::exists`\n- `user::group_exists`\n- `user::is_in_group`\n- `user::is_root`\n\u003c!-- MODULES:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdevera%2Fjdvlib.sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdevera%2Fjdvlib.sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdevera%2Fjdvlib.sh/lists"}