{"id":22769723,"url":"https://github.com/bfontaine/shortjs","last_synced_at":"2025-10-12T09:42:06.320Z","repository":{"id":29957967,"uuid":"33504677","full_name":"bfontaine/shortjs","owner":"bfontaine","description":"Shorten numbers","archived":false,"fork":false,"pushed_at":"2015-05-04T16:03:31.000Z","size":144,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:43:41.824Z","etag":null,"topics":["js","library"],"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/bfontaine.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":"2015-04-06T20:40:05.000Z","updated_at":"2019-04-22T09:02:04.000Z","dependencies_parsed_at":"2022-09-07T08:41:25.163Z","dependency_job_id":null,"html_url":"https://github.com/bfontaine/shortjs","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/bfontaine%2Fshortjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fshortjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fshortjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fshortjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfontaine","download_url":"https://codeload.github.com/bfontaine/shortjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246313056,"owners_count":20757421,"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":["js","library"],"created_at":"2024-12-11T15:14:48.120Z","updated_at":"2025-10-12T09:42:01.297Z","avatar_url":"https://github.com/bfontaine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Short.js\n\n**Short.js** is a small library that shortens text in JS, and that’s all. It\ncurrently only support numbers.\n\n## Usage\n\nNote: this is an alpha release, there’re no unit tests and it's only partially\nhand-tested for now. I just wanted a small lib for something I coded quite a\nfew times in different projects.\n\n### VanillaJS\n\nInclude `short.js`, then use it:\n\n```js\nconsole.log(short(\"foo bar\"))    // =\u003e \"foo bar\"\nconsole.log(short(\"42\"))         // =\u003e \"42\"\nconsole.log(short(\"42452\"))      // =\u003e \"42.1k\"\nconsole.log(short(\"721452\"))     // =\u003e \"0.7M\"\nconsole.log(short(\"1000721452\")) // =\u003e \"1.0G\"\n```\n\n### Angular\n\nInclude `bfn-short.js` after Angular then add it in your app:\n\n```js\nangular.module(\"yourApp\", [\"bfn.short\"]).\n  controller(\"foo\", function() {\n    // ...\n  });\n```\n\nThe module exposes only one filter:\n\n```html\n\u003cspan\u003e{{ thenumber | short }}\u003c/span\u003e\n```\n\n### jQuery\n\nInclude `jquery.short.js` after jQuery then use it:\n\n```js\n// replace the text of all elements of class 'myselector' using short.js\n$(\".myselector\").short();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fshortjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfontaine%2Fshortjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fshortjs/lists"}