{"id":20653024,"url":"https://github.com/3846masa/lit-date","last_synced_at":"2025-04-13T01:12:59.203Z","repository":{"id":32012803,"uuid":"131377180","full_name":"3846masa/lit-date","owner":"3846masa","description":"Light-weight, faster datetime formatter for modern browsers.","archived":false,"fork":false,"pushed_at":"2025-04-10T21:41:40.000Z","size":3332,"stargazers_count":37,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T22:31:44.260Z","etag":null,"topics":["date","datetime","format","formatter","javascript","lit-date","modern-browsers","template-literals","time","typescript"],"latest_commit_sha":null,"homepage":"","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/3846masa.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":"2018-04-28T05:48:07.000Z","updated_at":"2025-04-10T21:41:43.000Z","dependencies_parsed_at":"2024-04-15T19:52:54.127Z","dependency_job_id":"6535ae90-08f4-4637-a1da-b769f7c39815","html_url":"https://github.com/3846masa/lit-date","commit_stats":{"total_commits":936,"total_committers":5,"mean_commits":187.2,"dds":0.4636752136752137,"last_synced_commit":"a49eea0c1b6a25cf867dc872e8fd44372a2b4faa"},"previous_names":["3846masa/fdate"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3846masa%2Flit-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3846masa%2Flit-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3846masa%2Flit-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3846masa%2Flit-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3846masa","download_url":"https://codeload.github.com/3846masa/lit-date/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650754,"owners_count":21139681,"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":["date","datetime","format","formatter","javascript","lit-date","modern-browsers","template-literals","time","typescript"],"created_at":"2024-11-16T17:40:42.569Z","updated_at":"2025-04-13T01:12:59.173Z","avatar_url":"https://github.com/3846masa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⏰ lit-date\n\n[![NPM](https://img.shields.io/npm/v/lit-date?style=flat-square)](https://www.npmjs.com/package/lit-date)\n![filesize](https://img.shields.io/bundlephobia/minzip/lit-date?label=gzip\u0026color=brightgreen\u0026style=flat-square)\n[![codecov](https://img.shields.io/codecov/c/github/3846masa/lit-date?style=flat-square)](https://codecov.io/gh/3846masa/lit-date)\n\n\u003e Light-weight, faster datetime formatter for modern browsers.\n\n`lit-date` is ...\n\n- ⏰ Formatter for **Date** object\n- 👼 Light-weight (**~1kB** gzipped!)\n- 🦄 Very faster than other datetime libraries (e.g. `moment`)\n- 🆕 Powered by `Template literals`\n\n## Install\n\n### Node.js\n\n```bash\nnpm i --save lit-date\n# -- OR --\nyarn add lit-date\n```\n\n### Browser\n\n```html\n\u003cscript src=\"https://unpkg.com/lit-date\"\u003e\u003c/script\u003e\n```\n\n```html\n\u003cscript type=\"module\"\u003e\n  import litdate from 'https://unpkg.com/lit-date?module';\n\u003c/script\u003e\n```\n\n## Usage\n\n```js\nconst text = litdate`${'YYYY'}/${'MM'}/${'DD'}`(new Date());\nconsole.log(text);\n```\n\n```js\n// i18n\nconst dayOfWeek = ({ dayOfWeek }) =\u003e [...'日月火水木金土'][dayOfWeek];\nconst format = litdate`${'M'}月${'D'}日${dayOfWeek}曜日`;\nconsole.log(format(new Date()));\n```\n\nSee [examples](https://github.com/3846masa/lit-date/tree/main/examples).\n\n## Benchmark\n\nSee [benchmarks](https://github.com/3846masa/lit-date/tree/main/benchmarks) for more details.\n\n### Basic usage\n\n- `new Date()` -\u003e `2000/01/06`\n\n|         Chrome          |         Firefox          |\n| :---------------------: | :----------------------: |\n| ![Basic usage / Chrome] | ![Basic usage / Firefox] |\n\n[basic usage / chrome]: https://plot.ly/~3846masa/10.png?width=700\u0026height=700\n[basic usage / firefox]: https://plot.ly/~3846masa/4.png?width=700\u0026height=700\n\n### Advanced usage\n\n- `new Date()` -\u003e `1月6日(木)`\n\n|           Chrome           |           Firefox           |\n| :------------------------: | :-------------------------: |\n| ![Advanced usage / Chrome] | ![Advanced usage / Firefox] |\n\n[advanced usage / chrome]: https://plot.ly/~3846masa/6.png?width=700\u0026height=700\n[advanced usage / firefox]: https://plot.ly/~3846masa/7.png?width=700\u0026height=700\n\n### Bundle size\n\n|              |                size |                gzip |\n| :----------- | ------------------: | ------------------: |\n| tinydate     |    ![tinydate_size] |    ![tinydate_gzip] |\n| time-stamp   |  ![time-stamp_size] |  ![time-stamp_gzip] |\n| **lit-date** |    ![lit-date_size] |    ![lit-date_gzip] |\n| tinytime     |    ![tinytime_size] |    ![tinytime_gzip] |\n| date-format  | ![date-format_size] | ![date-format_gzip] |\n| dateformat   |  ![dateformat_size] |  ![dateformat_gzip] |\n| formatoid    |   ![formatoid_size] |   ![formatoid_gzip] |\n| fecha        |       ![fecha_size] |       ![fecha_gzip] |\n| dayjs        |       ![dayjs_size] |       ![dayjs_gzip] |\n| date-fns     |    ![date-fns_size] |    ![date-fns_gzip] |\n| luxon        |       ![luxon_size] |       ![luxon_gzip] |\n| moment       |      ![moment_size] |      ![moment_gzip] |\n\n[time-stamp_size]: https://img.shields.io/bundlephobia/min/time-stamp?label=size\u0026style=flat-square\n[lit-date_size]: https://img.shields.io/bundlephobia/min/lit-date?label=size\u0026style=flat-square\n[dateformat_size]: https://img.shields.io/bundlephobia/min/dateformat?label=size\u0026style=flat-square\n[fecha_size]: https://img.shields.io/bundlephobia/min/fecha?label=size\u0026style=flat-square\n[dayjs_size]: https://img.shields.io/bundlephobia/min/dayjs?label=size\u0026style=flat-square\n[date-fns_size]: https://img.shields.io/bundlephobia/min/date-fns?label=size\u0026style=flat-square\n[moment_size]: https://img.shields.io/bundlephobia/min/moment?label=size\u0026style=flat-square\n[luxon_size]: https://img.shields.io/bundlephobia/min/luxon?label=size\u0026style=flat-square\n[tinytime_size]: https://img.shields.io/bundlephobia/min/tinytime?label=size\u0026style=flat-square\n[tinydate_size]: https://img.shields.io/bundlephobia/min/tinydate?label=size\u0026style=flat-square\n[date-format_size]: https://img.shields.io/bundlephobia/min/date-format?label=size\u0026style=flat-square\n[formatoid_size]: https://img.shields.io/bundlephobia/min/formatoid?label=size\u0026style=flat-square\n[time-stamp_gzip]: https://img.shields.io/bundlephobia/minzip/time-stamp?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[lit-date_gzip]: https://img.shields.io/bundlephobia/minzip/lit-date?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[dateformat_gzip]: https://img.shields.io/bundlephobia/minzip/dateformat?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[fecha_gzip]: https://img.shields.io/bundlephobia/minzip/fecha?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[dayjs_gzip]: https://img.shields.io/bundlephobia/minzip/dayjs?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[date-fns_gzip]: https://img.shields.io/bundlephobia/minzip/date-fns?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[moment_gzip]: https://img.shields.io/bundlephobia/minzip/moment?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[luxon_gzip]: https://img.shields.io/bundlephobia/minzip/luxon?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[tinytime_gzip]: https://img.shields.io/bundlephobia/minzip/tinytime?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[tinydate_gzip]: https://img.shields.io/bundlephobia/minzip/tinydate?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[date-format_gzip]: https://img.shields.io/bundlephobia/minzip/date-format?label=gzip\u0026color=brightgreen\u0026style=flat-square\n[formatoid_gzip]: https://img.shields.io/bundlephobia/minzip/formatoid?label=gzip\u0026color=brightgreen\u0026style=flat-square\n\n## Contribute\n\nPRs accepted.\n\n## License\n\n[MIT (c) 3846masa](https://github.com/3846masa/lit-date/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3846masa%2Flit-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3846masa%2Flit-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3846masa%2Flit-date/lists"}