{"id":13804228,"url":"https://github.com/VeliovGroup/Meteor-Template-helpers","last_synced_at":"2025-05-13T17:31:43.936Z","repository":{"id":146650421,"uuid":"30079129","full_name":"veliovgroup/Meteor-Template-helpers","owner":"veliovgroup","description":"Template helpers for Session, logical operations and debug","archived":false,"fork":false,"pushed_at":"2022-05-31T14:19:16.000Z","size":67,"stargazers_count":35,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-15T00:12:07.035Z","etag":null,"topics":["helpers","javascript","meteor","meteor-package","meteorjs","template","templating"],"latest_commit_sha":null,"homepage":"https://atmospherejs.com/ostrio/templatehelpers","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veliovgroup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"dr-dimitru","custom":"https://paypal.me/veliovgroup"}},"created_at":"2015-01-30T15:59:41.000Z","updated_at":"2024-02-11T22:47:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"134b3c38-63d4-43a7-90c4-0c14b8857dc4","html_url":"https://github.com/veliovgroup/Meteor-Template-helpers","commit_stats":{"total_commits":55,"total_committers":5,"mean_commits":11.0,"dds":"0.18181818181818177","last_synced_commit":"7b0ef5dfdd60819c916d71f368646f01fcb8e989"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2FMeteor-Template-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2FMeteor-Template-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2FMeteor-Template-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veliovgroup%2FMeteor-Template-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veliovgroup","download_url":"https://codeload.github.com/veliovgroup/Meteor-Template-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225247848,"owners_count":17444124,"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":["helpers","javascript","meteor","meteor-package","meteorjs","template","templating"],"created_at":"2024-08-04T01:00:44.072Z","updated_at":"2025-05-13T17:31:43.929Z","avatar_url":"https://github.com/veliovgroup.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dr-dimitru","https://paypal.me/veliovgroup"],"categories":["Packages","Forms and Templates"],"sub_categories":[],"readme":"[![support](https://img.shields.io/badge/support-GitHub-white)](https://github.com/sponsors/dr-dimitru)\n[![support](https://img.shields.io/badge/support-PayPal-white)](https://paypal.me/veliovgroup)\n\u003ca href=\"https://ostr.io/info/built-by-developers-for-developers?ref=github-templatehelpers-repo-top\"\u003e\u003cimg src=\"https://ostr.io/apple-touch-icon-60x60.png\" alt=\"ostr.io free for open source maintainers\" height=\"20\"\u003e\u003c/a\u003e\n\u003ca href=\"https://meteor-files.com/?ref=github-templatehelpers-repo-top\"\u003e\u003cimg src=\"https://meteor-files.com/apple-touch-icon-60x60.png\" alt=\"meteor-files.com\" height=\"20\"\u003e\u003c/a\u003e\n\n# Meteor Template helpers\n\n__Features:__\n\n- 👨‍🔬 __100% tests coverage__;\n- 💡 Lightweight - No external dependencies, all feature helpers has __only__ *weak* dependencies;\n- ⚖️ Compare values with conditions - `{{#if compare one '===' two}} ... {{/if}}`;\n- 🐒 Get/set Session (*weak dependency*) - `{{Session 'key' set='value'}}`, `{{#if Session 'key'}} ... {{/if}}`;\n- 🔨 Use underscore's functions (*weak dependency*) - `{{#if _ 'isString' 'one'}} ... {{/if}}`;\n- 👨‍💻 Debug/log passed objects as a string to template - `{{log this.someVal 'string' object=\"value\"}}`.\n\n## Install:\n\n```shell\nmeteor add ostrio:templatehelpers\n```\n\n## Helpers\n\nUse comparison, conditional, and logical operations right in the Blaze templates. Get access to `Session` object ans stored values. Execute `underscore` package methods. And debug Blaze templating data using `log` helper.\n\n### Comparison helpers\n\nCompare template data. Create conditional `if` and `unless` blocks.\n\n#### Compare two values in template\n\n```handlebars\n{{#if compare 'one' '\u003e' 'two'}}\n  \u003c!-- ... --\u003e\n{{/if}}\n{{compare 'one' 'gt' 'two'}}\n{{compare 'one' 'greaterThan' 'two'}}\n\n{{compare 'one' '\u003e=' 'two'}}\n{{compare 'one' 'gte' 'two'}}\n{{compare 'one' 'greaterThanEqual' 'two'}}\n\n{{compare 'one' '\u003c' 'two'}}\n{{compare 'one' 'lt' 'two'}}\n{{compare 'one' 'lessThan' 'two'}}\n\n{{compare 'one' '\u003c=' 'two'}}\n{{compare 'one' 'lte' 'two'}}\n{{compare 'one' 'lessThanEqual' 'two'}}\n\n{{compare 'one' '===' 'two'}}\n{{compare 'one' 'is' 'two'}}\n\n{{compare 'one' '!==' 'two'}}\n{{compare 'one' 'isnt' 'two'}}\n\n{{compare 'one' '==' 'two'}}\n{{compare 'one' 'isEqual' 'two'}}\n\n{{compare 'one' '!=' 'two'}}\n{{compare 'one' 'isNotEqual' 'two'}}\n\n{{compare 'one' '\u0026\u0026' 'two'}}\n{{compare 'one' 'and' 'two'}}\n\n{{compare 'one' '\u0026!' 'two'}} \u003c!-- (a \u0026\u0026 !b) --\u003e\n{{compare 'one' '!\u0026' 'two'}} \u003c!-- (!a \u0026\u0026 b) --\u003e\n{{compare 'one' '!\u0026!' 'two'}} \u003c!-- (!a \u0026\u0026 !b) --\u003e\n{{compare 'one' '!\u0026\u0026' 'two'}} \u003c!-- !(a \u0026\u0026 b) --\u003e\n{{compare 'one' 'nand' 'two'}} \u003c!-- !(a \u0026\u0026 b) --\u003e\n\n{{compare 'one' '||' 'two'}}\n{{compare 'one' 'or' 'two'}}\n\u003c!-- Or statements returns real values --\u003e\n\u003c!-- For example you have one falsy value and another not --\u003e\n\u003c!-- Truthy value will be returned then (as in real JS-script) --\u003e\n\n{{compare 'one' '|!' 'two'}} \u003c!-- (a || !b) --\u003e\n{{compare 'one' '!|' 'two'}} \u003c!-- (!a || b) --\u003e\n{{compare 'one' '!|!' 'two'}} \u003c!-- (!a || !b) --\u003e\n{{compare 'one' '!||' 'two'}} \u003c!-- !(a || b) --\u003e\n{{compare 'one' 'nor' 'two'}} \u003c!-- !(a || b) --\u003e\n\n{{compare 'one' 'xor' 'two'}} \u003c!-- ((a \u0026\u0026 !b) || (!a \u0026\u0026 b)) --\u003e\n{{compare 'one' 'nxor' 'two'}} \u003c!-- !((a \u0026\u0026 !b) || (!a \u0026\u0026 b)) --\u003e\n```\n\n#### Compare many to many\n\nCompare complex template data.\n\n```handlebars\n{{#if compare 1 '\u003e' 2 '\u0026\u0026' 5 '\u003c' 8}}\n  \u003c!-- ... --\u003e\n{{/if}}\n{{compare 1 '\u003e' 2 '||' 5 '\u003c' 8}}\n{{compare first '||' second '||' third}}\n{{compare first '\u0026\u0026' second '\u0026\u0026' third}}\n{{compare first '\u0026\u0026' second '||' third}}\n\u003c!-- Any combinations will work, above just basic examples --\u003e\n```\n\n#### Compare one value to many (any of.. match)\n\nCompare single value against many (*any of.. match*).\n\n```handlebars\n{{#if compare 'one' '\u003e' 'two|one|three|four|five'}}\n  \u003c!-- ... --\u003e\n{{/if}}\n{{compare 'one' '\u003e=' 'two|one|three|four|five'}}\n{{compare 'one' '\u003c' 'two|one|three|four'}}\n{{compare 'one' '\u003c=' 'two|one|three'}}\n{{compare 'one' '===' 'two|one'}}\n{{compare 'one' '!==' 'two|one|three'}}\n{{compare 'one' '==' 'two|one|three|four'}}\n{{compare 'one' '!=' 'two|one|three|four'}}\n{{compare 'one' '\u0026\u0026' 'two|one|three|four'}}\n```\n\n### `log`\n\nTemplate debugging - Log arguments into browser's console with output into template\n\n```handlebars\n{{log 'val' opt='val2' opt2=variable}}\n```\n\nAdd `console=true` as an argument to log values into JS-console\n\n```handlebars\n{{log 'val' opt='val2' opt2=variable console=true}}\n```\n\n### `Session`\n\nGet or set session value from views via Session helper\n\n```handlebars\n\u003c!-- To get value --\u003e\n{{Session 'key'}}\n\n\u003c!-- To set value --\u003e\n{{Session 'key' set=\"new value\"}}\n\n\u003c!-- To set default value --\u003e\n{{Session 'key' set=\"new value\" action=\"setDefault\"}}\n```\n\n### Underscore (all methods)\n\nExecute underscore methods in template\n\n```handlebars\n{{#if _ 'isString' 'one'}}\n  ...\n{{/if}}\n```\n\n## Running Tests\n\n1. Clone this package\n2. In Terminal (*Console*) go to directory where package is cloned\n3. Then run:\n\n### Meteor/Tinytest\n\n```shell\n# Default\nmeteor test-packages ./\n\n# With custom port\nmeteor test-packages ./ --port 8888\n```\n\n- Upload and share files using [☄️ meteor-files.com](https://meteor-files.com/?ref=github-templatehelpers-repo-footer) — Continue interrupted file uploads without losing any progress. There is nothing that will stop Meteor from delivering your file to the desired destination\n- Use [▲ ostr.io](https://ostr.io?ref=github-templatehelpers-repo-footer) for [Server Monitoring](https://snmp-monitoring.com), [Web Analytics](https://ostr.io/info/web-analytics?ref=github-templatehelpers-repo-footer), [WebSec](https://domain-protection.info), [Web-CRON](https://web-cron.info), and [SEO Pre-rendering](https://prerendering.com) of a website\n- Star on [GitHub](https://github.com/veliovgroup/Meteor-Template-helpers)\n- Star on [Atmosphere](https://atmospherejs.com/ostrio/templatehelpers)\n- [Sponsor via GitHub](https://github.com/sponsors/dr-dimitru)\n- [Support via PayPal](https://paypal.me/veliovgroup)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVeliovGroup%2FMeteor-Template-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVeliovGroup%2FMeteor-Template-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVeliovGroup%2FMeteor-Template-helpers/lists"}