{"id":19909029,"url":"https://github.com/dyne/zuper","last_synced_at":"2025-05-03T02:31:32.224Z","repository":{"id":28991240,"uuid":"32517969","full_name":"dyne/zuper","owner":"dyne","description":"Zsh Ultimate Programmer's Extensions Refurbished","archived":false,"fork":false,"pushed_at":"2017-11-29T19:56:13.000Z","size":54,"stargazers_count":7,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T10:35:43.999Z","etag":null,"topics":["shell","zsh"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dyne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-19T11:41:51.000Z","updated_at":"2021-09-02T08:23:21.000Z","dependencies_parsed_at":"2022-08-03T02:31:01.649Z","dependency_job_id":null,"html_url":"https://github.com/dyne/zuper","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/dyne%2Fzuper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fzuper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fzuper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyne%2Fzuper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyne","download_url":"https://codeload.github.com/dyne/zuper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252133720,"owners_count":21699586,"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":["shell","zsh"],"created_at":"2024-11-12T21:14:12.778Z","updated_at":"2025-05-03T02:31:31.961Z","avatar_url":"https://github.com/dyne.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n _  _  _  _  _\n(_)(_)(_)(_)(_)\n          _(_)_         _   _  _  _  _    _  _  _  _  _       _  _\n        _(_) (_)       (_) (_)(_)(_)(_)_ (_)(_)(_)(_)(_)_  _ (_)(_)\n      _(_)   (_)       (_) (_)        (_(_) _  _  _ (_)(_)(_)\n    _(_)     (_)       (_) (_)        (_(_)(_)(_)(_)(_)(_)\n _ (_) _  _  (_)_  _  _(_)_(_) _  _  _(_(_)_  _  _  _  (_)\n(_)(_)(_)(_)(_)(_)(_)(_) (_(_)(_)(_)(_)   (_)(_)(_)(_) (_)\n                           (_)\n                           (_)\n```\n\n**Z**sh **U**ltimate **P**rogrammer's **E**xtensions **R**efurbished\n\n# Introduction\n\nZuper is a minimalist library of extensions for Zsh programming,\nbecause believe it or not Zsh is so slick and powerful that it can be\nused as a programming language.\n\n# Features\n\n - key/value store on files mapped to associative arrays\n - consul k/v integration using native get/set over ztcp\n - nifty messaging using colors and intl support (gettext)\n - procedural flow debugging functions and variable monitor\n - clean exit and destructors registration\n - improved temp file handling\n - more to come...\n\n# Requirements\n\nZuper requires the following programs to be installed:\n\n```\nzsh curl sed awk hexdump\n```\n\n# Usage\n\nDocumentation is still lacking, however to use Zuper in Zsh scripts\none must first source its main library `zuper`, then declare global\nvariables and arrays, then source `zuper.init` and at the end of the\nprogram call `endgame` for a clean exit. Example test program:\n\n```zsh\n#!/usr/bin/env zsh\n\n# switch on debugging output\nDEBUG=1\n\n# switch logging into test.log\nLOG=test.log\n\n##### INIT\n# load our zuper library\nsource zuper\n# declare a custom global variable\nvars+=(myvar)\n# assign a default value to our global variable\nmyvar=${myvar:-ok}\n# declare a global associative map\nmaps+=(mymap)\n# conclude the init phase\nsource zuper.init\n#####\n\n# register the zdump debug function to be executed on exit\ndestruens+=(zdump)\n\n\n# declare a custom function to print it out\ntestfun() {\n    # register the function in the debug flow\n    fn \"testfun\"\n    # print out with nice green colors\n    notice \"Custom var: $myvar\"\n    # create a tempfile\n    ztmp \u0026\u0026 mytmp=$ztmpfile\n    # put the value into the tempfile\n    print $myvar \u003e\u003e $mytmp\n    # print out the path to the tempfile\n    act \"Temp file: $mytmp\"\n    # print out the contents of the tempfile\n    act \"Content: `cat $mytmp`\"\n    # the tempfile will be deleted in endgame()\n    # but can also be delete earlier here, optionally\n}\n\n\n# call our custom function\ntestfun\n\n# we use words and their md5\nmymap=(\n    lorem f737a087bca81f69a6048ec744c73e41\n    ipsum 02063b9bf9d6e15ad61226fa4584aae0\n    dolor 5f20730ddc7a1fedbf265358f0ce4f26\n)\n\n# save the map into a file\nzkv.save mymap test.map\n\n# free the map\nmymap=()\n\n# re-declare the map\ntypeset -A mymap\n# re-load saved contents\nzkv.load test.map\n# dump contents\nfor i in ${(k)mymap}; do\n    print \"$i \\t ${mymap[$i]}\"\ndone\n\n# end of the program (will call destructors)\n```\n\n\n# Deployment\n\nHere we reference applications where zuper is used succesfully:\n\n - Devuan Simple Development Toolkit https://git.devuan.org/groups/sdk\n - Dowse IoT awareness OS http://dyne.org/software/dowse\n - Jaro Mail terminal email http://dyne.org/software/jaro-mail\n\nIf you use it, let us know! http://dyne.org/contact\n\n# License\n\nZuper is designed, developed and maintained by Denis Roio \u003cjaromil@dyne.org\u003e\n\nZuper is Copyright (C) 2015 by the Dyne.org foundation\n\nThis source code is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Public License as published by\nthe Free Software Foundation; either version 3 of the License, or (at\nyour option) any later version.\n\nThis source code is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Please refer to\nthe GNU Public License for more details.\n\nYou should have received a copy of the GNU Public License along with\nthis source code; if not, write to: Free Software Foundation, Inc.,\n675 Mass Ave, Cambridge, MA 02139, USA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Fzuper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyne%2Fzuper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyne%2Fzuper/lists"}