{"id":22296435,"url":"https://github.com/knowledgecode/fast-format","last_synced_at":"2025-07-29T01:32:30.355Z","repository":{"id":34293184,"uuid":"38190618","full_name":"knowledgecode/fast-format","owner":"knowledgecode","description":"A fast, simple string formatter like util.format() method in Node.js","archived":false,"fork":false,"pushed_at":"2017-02-04T16:31:24.000Z","size":15,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T00:05:05.417Z","etag":null,"topics":[],"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/knowledgecode.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-06-28T07:36:41.000Z","updated_at":"2018-09-25T02:33:20.000Z","dependencies_parsed_at":"2022-08-31T14:10:57.923Z","dependency_job_id":null,"html_url":"https://github.com/knowledgecode/fast-format","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/knowledgecode/fast-format","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledgecode%2Ffast-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledgecode%2Ffast-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledgecode%2Ffast-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledgecode%2Ffast-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knowledgecode","download_url":"https://codeload.github.com/knowledgecode/fast-format/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knowledgecode%2Ffast-format/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267616580,"owners_count":24116154,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-03T17:45:35.358Z","updated_at":"2025-07-29T01:32:30.066Z","avatar_url":"https://github.com/knowledgecode.png","language":"JavaScript","readme":"# fast-format\n[![Circle CI](https://circleci.com/gh/knowledgecode/fast-format.svg?style=shield)](https://circleci.com/gh/knowledgecode/fast-format)\n\nThis is a string formatter like `util.format()` method in Node.js, supports just only `%s` placeholder but accordingly faster than that. It will be one of the best solution if need a speed rather than complex formatting.\n\n## Usage\nSame as `util.format()` method.\n```js\nformat(formatString[, ...])\n```\n\nIf use one formatting repeatedly, recommended to compile the `formatString` in advance.\n```js\nformat.compile(formatString)\n```\n\n## Example\n```js\nlet s = format('%s, %s!', 'Hello', 'world');\nconsole.log(s);     // =\u003e 'Hello, world!'\n```\n```js\nlet f = format.compile('%s, %s!');\nlet s1 = f('Hello', 'world');\nconsole.log(s1);    // =\u003e 'Hello, world!'\nlet s2 = f('Howdy', 'World');\nconsole.log(s2);    // =\u003e 'Howdy, World!'\n```\n\n## Benchmark\n```js\n// Bench 1\nlet s = Date.now();\nfor (let i = 0, len = 100000000; i \u003c len; i++) {\n    format('i = %s, len = %s', i, len);\n}\nconsole.log(Date.now() - s);\n```\n```js\n// Bench 2\nlet s = Date.now();\nlet f = format.compile('i = %s, len = %s');\nfor (let i = 0, len = 100000000; i \u003c len; i++) {\n    f(i, len);\n}\nconsole.log(Date.now() - s);\n```\n\n*environment1: Core i7 2.2GHz + Node.js v6.9.5*\n\n\u003cimg src=\"https://cdn.rawgit.com/knowledgecode/fast-format/ee4147a012f4d179c84e94a5f549f741fb5a5069/img/graph1.svg\"\u003e\n\n| module      | time        | bench |\n|-------------|-------------|:-----:|\n| fast-format | 12,388 msec |     2 |\n| fast-format | 22,039 msec |     1 |\n| util.format | 28,659 msec |     1 |\n\n---\n*environment2: Core i7 2.2GHz + Google Chrome 56.0.2924.87*\n\n\u003cimg src=\"https://cdn.rawgit.com/knowledgecode/fast-format/ee4147a012f4d179c84e94a5f549f741fb5a5069/img/graph2.svg\"\u003e\n\n| module      | time        | bench |\n|-------------|-------------|:-----:|\n| fast-format | 12,898 msec |     2 |\n| fast-format | 22,705 msec |     1 |\n| util.format | 99,103 msec |     1 |\n\nThe `util.format()` method was converted with `Browserify` to run on the browser.\n\n## Installation\n### via npm\n```sh\nnpm install fast-format --save\n```\n\n### via Bower\n```sh\nbower install fast-format\n```\n\n### directly (in case of the browser)\n``` html\n\u003cscript src=\"/path/to/fast-format.min.js\"\u003e\u003c/script\u003e\n```\n\n## Browser Support\nGoogle Chrome, Firefox, Safari, Opera, Microsoft Edge and IE 6+\n\n## License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowledgecode%2Ffast-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknowledgecode%2Ffast-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowledgecode%2Ffast-format/lists"}