{"id":16788728,"url":"https://github.com/markmead/alpinejs-money","last_synced_at":"2025-03-17T03:30:18.847Z","repository":{"id":45230544,"uuid":"442893877","full_name":"markmead/alpinejs-money","owner":"markmead","description":"Format money through Alpine JS into any language and currency (works with Shopify settings) 💸","archived":false,"fork":false,"pushed_at":"2025-03-07T08:12:50.000Z","size":34,"stargazers_count":38,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T07:41:20.131Z","etag":null,"topics":["alpine-js","alpinejs","alpinejs-plugin","javascript","money","shopify"],"latest_commit_sha":null,"homepage":"https://js.hyperui.dev/examples/utility-format-currency","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/markmead.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":"2021-12-29T21:24:45.000Z","updated_at":"2025-03-11T19:53:18.000Z","dependencies_parsed_at":"2024-10-27T11:55:34.402Z","dependency_job_id":"79081359-3d97-4fe0-98b3-dc3c8e1cac5c","html_url":"https://github.com/markmead/alpinejs-money","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/markmead%2Falpinejs-money","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmead%2Falpinejs-money/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmead%2Falpinejs-money/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmead%2Falpinejs-money/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markmead","download_url":"https://codeload.github.com/markmead/alpinejs-money/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243968379,"owners_count":20376388,"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":["alpine-js","alpinejs","alpinejs-plugin","javascript","money","shopify"],"created_at":"2024-10-13T08:24:30.307Z","updated_at":"2025-03-17T03:30:18.521Z","avatar_url":"https://github.com/markmead.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alpine JS Money\n\nFormat money through Alpine JS into any language and currency 💸\n\n## Install\n\n### With a CDN\n\n```html\n\u003cscript\n  defer\n  src=\"https://unpkg.com/alpinejs-money@latest/dist/money.min.js\"\n\u003e\u003c/script\u003e\n\n\u003cscript defer src=\"https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js\"\u003e\u003c/script\u003e\n```\n\n### With a Package Manager\n\n```shell\nnpm install -D alpinejs-money\n\nyarn add -D alpinejs-money\n```\n\n```js\nimport Alpine from 'alpinejs'\nimport money from 'alpinejs-money'\n\nAlpine.plugin(money)\n\nAlpine.start()\n```\n\n## Example\n\n### Basic\n\n```html\n\u003cdiv x-data=\"{ priceInt: 9999, priceDec: 99.99 }\"\u003e\n  \u003cp x-money.en-GB.GBP=\"priceInt\"\u003e\u003c/p\u003e\n  \u003cp x-money.ja-JP.JPY=\"priceInt\"\u003e\u003c/p\u003e\n  \u003cp x-money.en-US.USD=\"priceInt\"\u003e\u003c/p\u003e\n\n  \u003c!-- Decimal --\u003e\n  \u003cp x-money.en-GB.GBP.decimal=\"priceDec\"\u003e\u003c/p\u003e\n  \u003cp x-money.ja-JP.JPY.decimal=\"priceDec\"\u003e\u003c/p\u003e\n  \u003cp x-money.en-US.USD.decimal=\"priceDec\"\u003e\u003c/p\u003e\n\u003c/div\u003e\n```\n\n### With Data Attributes\n\n```html\n\u003cdiv x-data=\"{ priceInt: 9999, priceDec: 99.99 }\"\u003e\n  \u003cp x-money=\"priceInt\" data-locale=\"en-GB\" data-currency=\"GBP\"\u003e\u003c/p\u003e\n  \u003cp x-money=\"priceInt\" data-locale=\"ja-JP\" data-currency=\"JPY\"\u003e\u003c/p\u003e\n  \u003cp x-money=\"priceInt\" data-locale=\"en-US\" data-currency=\"USD\"\u003e\u003c/p\u003e\n\n  \u003c!-- Decimal --\u003e\n  \u003cp x-money.decimal=\"priceDec\" data-locale=\"en-GB\" data-currency=\"GBP\"\u003e\u003c/p\u003e\n  \u003cp x-money.decimal=\"priceDec\" data-locale=\"ja-JP\" data-currency=\"JPY\"\u003e\u003c/p\u003e\n  \u003cp x-money.decimal=\"priceDec\" data-locale=\"en-US\" data-currency=\"USD\"\u003e\u003c/p\u003e\n\u003c/div\u003e\n```\n\n### With Global\n\n```html\n\u003cdiv x-data=\"{ priceInt: 9999, priceDec: 99.99 }\"\u003e\n  \u003cp x-money.global=\"priceInt\"\u003e\u003c/p\u003e\n  \u003cp x-money.global.decimal=\"priceDec\"\u003e\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will look for `locale` and `currency` which is on the global `xMoney`\nobject.\n\n```js\nwindow.xMoney = {\n  locale: 'en-CA',\n  currency: 'CAD',\n}\n```\n\n### With Shopify\n\n```html\n\u003cdiv x-data=\"{ priceInt: 9999, priceDec: 99.99 }\"\u003e\n  \u003cp x-money.shopify=\"priceInt\"\u003e\u003c/p\u003e\n  \u003cp x-money.shopify.decimal=\"priceDec\"\u003e\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis will look for `Shopify.locale` and `Shopify.currency.active` which is on\nthe global `Shopify` object.\n\nIf this isn't set by default then you can set it like this.\n\n```js\nwindow.Shopify = {\n  locale: 'en-CA',\n  currency: {\n    active: 'CAD',\n  },\n}\n```\n\n### Stats\n\n![](https://img.shields.io/bundlephobia/min/alpinejs-money)\n![](https://img.shields.io/npm/v/alpinejs-money)\n![](https://img.shields.io/npm/dt/alpinejs-money)\n![](https://img.shields.io/github/license/markmead/alpinejs-money)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmead%2Falpinejs-money","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkmead%2Falpinejs-money","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmead%2Falpinejs-money/lists"}