be-intl
TypeScript icon, indicating that this package has built-in type declarations

0.0.27 • Public • Published

be-intl

Format numbers, dates automatically and semantically.

Playwright Tests How big is this package in your project? NPM version

<data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'></data>

emits

<data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'>123.456,79 €</data>

The output element provides identical support.

<time lang="ar-EG" datetime=2011-11-18T14:54:39.929Z be-intl='{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }'></time>

emits

<time lang="ar-EG" datetime="2011-11-18T14:54:39.929Z" be-intl="{ &quot;weekday&quot;: &quot;long&quot;, &quot;year&quot;: &quot;numeric&quot;, &quot;month&quot;: &quot;long&quot;, &quot;day&quot;: &quot;numeric&quot; }">الجمعة، ١٨ نوفمبر ٢٠١١</time>

[TODO] Support expanding out the attribute to avoid use of JSON

Viewing Locally

Any web server than can serve static files will do, but...

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. Open http://localhost:3030/demo in a modern browser.

Importing in ES Modules:

import 'be-intl/be-intl.js';

Using from CDN:

<script type=module crossorigin=anonymous>
    import 'https://esm.run/be-intl';
</script>

Package Sidebar

Install

npm i be-intl

Weekly Downloads

2

Version

0.0.27

License

MIT

Unpacked Size

8.29 kB

Total Files

6

Last publish

Collaborators

  • bahrus