{"id":19384612,"url":"https://github.com/brunos3d/pupo","last_synced_at":"2025-06-13T00:06:11.923Z","repository":{"id":101228594,"uuid":"313814213","full_name":"brunos3d/pupo","owner":"brunos3d","description":"📦 NODE.JS - Simple micro templating based on pupa using object-path.","archived":false,"fork":false,"pushed_at":"2020-11-18T13:24:13.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T20:00:53.175Z","etag":null,"topics":["format","formatting","interpolate","intl","json","micro","object","object-path","placeholders","replace","simple","string","template","transform"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pupo","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/brunos3d.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-18T03:37:10.000Z","updated_at":"2024-08-28T22:51:30.000Z","dependencies_parsed_at":"2023-03-13T15:28:16.783Z","dependency_job_id":null,"html_url":"https://github.com/brunos3d/pupo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brunos3d/pupo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunos3d%2Fpupo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunos3d%2Fpupo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunos3d%2Fpupo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunos3d%2Fpupo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunos3d","download_url":"https://codeload.github.com/brunos3d/pupo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunos3d%2Fpupo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259553131,"owners_count":22875609,"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":["format","formatting","interpolate","intl","json","micro","object","object-path","placeholders","replace","simple","string","template","transform"],"created_at":"2024-11-10T09:31:40.721Z","updated_at":"2025-06-13T00:06:11.886Z","avatar_url":"https://github.com/brunos3d.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pupo \n\n[![npm version](https://badge.fury.io/js/pupo.svg)](http://badge.fury.io/js/pupo)\n[![npm downloads](https://img.shields.io/npm/dm/pupo.svg)](http://badge.fury.io/js/pupo)\n[![Build Status](https://travis-ci.org/BrunoS3D/pupo.svg?branch=main)](https://travis-ci.org/BrunoS3D/pupo)\n[![object-path Dependency](https://img.shields.io/npm/dependency-version/pupo/object-path)](https://www.npmjs.com/package/object-path)\n[![escape-goat Dependency](https://img.shields.io/npm/dependency-version/pupo/escape-goat)](https://www.npmjs.com/package/escape-goat)\n[![Visitors](https://visitor-badge.glitch.me/badge?page_id=BrunoS3D/pupo)](https://github.com/BrunoS3D/pupo)\n\n\u003e 📦 NODE.JS - Simple micro templating based on pupa using object-path.\n\nUseful when all you need is to fill in some placeholders.\n\nPupo implements the [object-path](https://www.npmjs.com/package/object-path) package to resolve the values of the data object.\n\n## Install\n\n\u003e \n\n```\n$ npm install pupo\n\n# or\n\n$ yarn add pupo\n```\n\n## Usage\n\n```js\nconst pupo = require(\"pupo\");\n\npupo(\"The mobile number of {name} is {phone.mobile}\", {\n    name: \"Foo\",\n    phone: {\n        mobile: \"100 20 300\",\n    },\n});\n//=\u003e 'The mobile number of Foo is 100 20 300'\n\npupo(\"I like {0} and {1}\", [\"🦄\", \"🐮\"]);\n//=\u003e 'I like 🦄 and 🐮'\n\n// Double braces encodes the HTML entities to avoid code injection\npupo(\"I like {{0}} and {{1}}\", [\"\u003cbr\u003e🦄\u003c/br\u003e\", \"\u003ci\u003e🐮\u003c/i\u003e\"]);\n//=\u003e 'I like \u0026lt;br\u0026gt;🦄\u0026lt;/br\u0026gt; and \u0026lt;i\u0026gt;🐮\u0026lt;/i\u0026gt;'\n\n// Deep object value\npupo(\"{deep.obj.value-foo}\", {\n    deep: {\n        obj: {\n            \"value-foo\": \"Hello, World!\",\n        },\n    },\n});\n//=\u003e 'This is a deep object value: Hello, World!'\n\n// Format using object with special key names\npupo(\"{foo bar} {12 345} {value-foo}\", {\n    \"foo bar\": \"Foo Bar\",\n    \"12 345\": \"12345\",\n    \"value-foo\": \"Hello, World!\",\n});\n//=\u003e 'Foo Bar 12345 Hello, World!'\n```\n\n## API\n\n### pupo(template, data)\n\n#### template\n\nType: `string`\n\nText with placeholders for `data` properties.\n\n#### data\n\nType: `object | unknown[]`\n\nData to interpolate into `template`.\n\n## FAQ\n\n### What about template literals?\n\nTemplate literals expand on creation. This module expands the template on execution, which can be useful if either or both template and data are lazily created or user-supplied.\n\n## Related\n\n-   [pupa](https://github.com/sindresorhus/pupa) - The original package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunos3d%2Fpupo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunos3d%2Fpupo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunos3d%2Fpupo/lists"}