{"id":21889228,"url":"https://github.com/dmester/sffjs","last_synced_at":"2025-04-15T10:30:27.270Z","repository":{"id":23859436,"uuid":"27237599","full_name":"dmester/sffjs","owner":"dmester","description":"String.format for Javascript mimicking the .NET String.Format method.","archived":false,"fork":false,"pushed_at":"2021-07-04T18:24:53.000Z","size":14984,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T19:12:42.353Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-27T18:45:26.000Z","updated_at":"2024-08-08T19:15:09.000Z","dependencies_parsed_at":"2022-08-21T05:00:37.673Z","dependency_job_id":null,"html_url":"https://github.com/dmester/sffjs","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmester%2Fsffjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmester%2Fsffjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmester%2Fsffjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmester%2Fsffjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmester","download_url":"https://codeload.github.com/dmester/sffjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249051451,"owners_count":21204813,"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":[],"created_at":"2024-11-28T11:20:39.079Z","updated_at":"2025-04-15T10:30:27.245Z","avatar_url":"https://github.com/dmester.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿\n# String.format for JavaScript\n\nThis is a JavaScript library for string, date and number formatting. Formatting \nis done using format strings almost completely compatible with the `String.Format` \nmethod in Microsoft .NET Framework.\n\n## How to use\n\nTo use the library, include the library itself and optionally the cultures you \nare targetting. Note that if no culture files are included, the invariant \nculture will be used.\n\n```HTML\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@dmester/sffjs@1.17.0/dist/stringformat.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@dmester/sffjs@1.17.0/dist/cultures/stringformat.en.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@dmester/sffjs@1.17.0/dist/cultures/stringformat.sv.js\"\u003e\u003c/script\u003e\n```\n\nThen you're ready to go. Here are two simple examples using indexes and object\npaths/named parameters.\n\n```JavaScript\n// Index\nString.format(\n    \"Welcome back, {0}! Last seen {1:M}\", \n    \"John Doe\", new Date(1985, 3, 7, 12, 33)\n    );\n    \n// Outputs: \n// Welcome back, John Doe! Last seen April 07\n\n// Named parameters\nString.format(\n    \"Welcome back, {user.name}! Last seen {lastseen:M}\", \n    { \n        user: {\n            name : \"John Doe\", \n            age : 42\n        },\n        lastseen: new Date(2009, 3, 7, 12, 33) \n    });\n    \n// Outputs: \n// Welcome back, John Doe! Last seen April 07\n```\n\nBy default the browser culture will be used, given that the appropriate culture \nfile has been referenced from the page. To set culture explicitly, use the \n`sffjs.setCulture` method, which accepts a IETF language code.\n\n```JavaScript\nsffjs.setCulture(\"sv\");\n```\n\n## Browser support\n\nsffjs is tested in IE9 and later, Chrome, Firefox and Edge, but may work in\nother environments.\n\n## See more\n\n* [Compatibility with .NET Framework](https://github.com/dmester/sffjs/blob/master/docs/Compatiblity%20with%20.NET%20Framework.md)\n* [More usage examples](https://github.com/dmester/sffjs/blob/master/docs/Usage%20examples.md)\n* [Working with cultures](https://github.com/dmester/sffjs/blob/master/docs/Working%20with%20cultures.md)\n* [Extending sffjs with support for custom classes](https://github.com/dmester/sffjs/blob/master/docs/Extending%20sffjs.md)\n* [Reference information regarding .NET format strings](http://msdn.microsoft.com/en-us/library/system.string.format.aspx)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmester%2Fsffjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmester%2Fsffjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmester%2Fsffjs/lists"}