{"id":28042265,"url":"https://github.com/fl3xice/humanity","last_synced_at":"2026-05-07T10:38:22.708Z","repository":{"id":41446961,"uuid":"509603209","full_name":"fl3xice/humanity","owner":"fl3xice","description":"Humanizer for Deno \u0026 NodeJS","archived":false,"fork":false,"pushed_at":"2022-07-05T00:28:26.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T09:06:16.673Z","etag":null,"topics":["deno","humanizer","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fl3xice.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}},"created_at":"2022-07-01T22:27:09.000Z","updated_at":"2022-07-02T04:35:10.000Z","dependencies_parsed_at":"2022-09-21T10:02:34.136Z","dependency_job_id":null,"html_url":"https://github.com/fl3xice/humanity","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/fl3xice/humanity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fl3xice%2Fhumanity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fl3xice%2Fhumanity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fl3xice%2Fhumanity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fl3xice%2Fhumanity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fl3xice","download_url":"https://codeload.github.com/fl3xice/humanity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fl3xice%2Fhumanity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265624180,"owners_count":23800341,"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":["deno","humanizer","nodejs"],"created_at":"2025-05-11T14:25:09.120Z","updated_at":"2026-05-07T10:38:22.680Z","avatar_url":"https://github.com/fl3xice.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Humanity\n\n[![Deno](https://github.com/fl3xice/humanity/actions/workflows/deno.yml/badge.svg)](https://github.com/fl3xice/humanity/actions/workflows/deno.yml)\n![GitHub](https://img.shields.io/github/license/fl3xice/humanity)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/fl3xice/humanity)\n[![npm](https://img.shields.io/npm/v/humanity-deno)](https://www.npmjs.com/package/humanity-deno)\n[![deno module](https://shield.deno.dev/x/humanity)](https://deno.land/x/humanity)\n\n![GitHub Repo stars](https://img.shields.io/github/stars/fl3xice/humanity?style=social)\n\nHumanity is a library for humanizing data in a human-readable form.\n\n## How to use\n\n### Deno\n\n```typescript\nimport { createHumanity } from \"https://deno.land/x/humanity/mod.ts\";\n\nconst Humanity = createHumanity(\"en_US\");\n\nconsole.log(Humanity.number(500000)); // 500 000\n// Output: 500 thousand\n```\n\n### NodeJS\n\nYou can use it library with NodeJS\n\n```\nnpm i humanity-deno\n```\n\n```javascript\nconst { createHumanity } = require(\"humanity-deno\");\n\nconst Humanity = createHumanity(\"en_US\");\n\nconsole.log(Humanity.number(500000)); // 500 000\n// Output: 500 thousand\n```\n\n## You can use custom language\n\n```typescript\nimport { createCustomHumanity } from \"https://deno.land/x/humanity/mod.ts\";\nconst Humanity = createCustomHumanity({\n    locale: \"custom\",\n    words: {\n        ...DefaultLocales.en_US.words,\n    },\n    numbers: {\n        thousand: \"th\",\n        million: \"m\",\n        billion: \"b\",\n        trillion: \"t\",\n        quadrillion: \"q\",\n        quintillion: \"qui\",\n    },\n});\n\nconsole.log(Humanity.number(500000)); // 500 th\n```\n\n## Disable spaces between number and word\n\n```typescript\nHumanity.disableFeature(\"spacing\");\nconsole.log(Humanity.number(500000)); // 500thousand\n```\n\n## Available functions\n\n-   number(n: number | bigint): string \u003cbr/\u003e `Humanity.number(500000) // 500 thousand`\n-   truncate(n: string | number | bigint, lengthMax: number): string \u003cbr/\u003e `Humanity.truncate(\"Humanity is a library for humanizing data in a human-readable form.\", 24) // \"Humanity is a library fo...\"`\n-   toRoman(n: number): string \u003cbr/\u003e `Humanity.toRoman(505) // DV`\n-   binarySuffix(n: number, fixed = 2): string \u003cbr/\u003e `Humanity.binarySuffix(500, 0) // 500 B`\n-   arrayToText(arr: any[], n = 2): string \u003cbr/\u003e `Humanity.arrayToText([\"Dustin\", \"Leda\", \"Tristin\", \"Maybelle\", \"Dee\", \"Stephon\"], 3) // Dustin, Leda, Tristin and 3 others`\n-   dateTime.difference(dateFirst: Date, dateAfter: Date): string \u003cbr/\u003e `Humanity.dateTime.difference(1656532800000, 1659211200000); // 4 weeks ago`\n-   Humanity.humanCase(data: string): string \u003cbr/\u003e `Humanity.humanCase(\"mainField\") // \"Main field\"`\n\n## Supported languages by default\n\n_You can customize defaults the language and create yourself language_\n\n-   `en_US`\n-   `de_DE`\n-   `ru_RU`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffl3xice%2Fhumanity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffl3xice%2Fhumanity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffl3xice%2Fhumanity/lists"}