{"id":25652370,"url":"https://github.com/hyperweb-io/strfy-js","last_synced_at":"2025-10-12T19:10:16.507Z","repository":{"id":233074211,"uuid":"785947441","full_name":"hyperweb-io/strfy-js","owner":"hyperweb-io","description":"Stringify JSON as JavaScript","archived":false,"fork":false,"pushed_at":"2024-06-04T05:57:02.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-22T02:37:33.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hyperweb-io.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":"2024-04-13T01:29:51.000Z","updated_at":"2025-01-17T23:42:27.000Z","dependencies_parsed_at":"2024-05-17T08:28:12.233Z","dependency_job_id":"bbb8d73d-09f2-4741-b45b-e6d235e5b24c","html_url":"https://github.com/hyperweb-io/strfy-js","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"07376240c61d7d426aa450c37203fb80af007985"},"previous_names":["pyramation/strfy-js","hyperweb-io/strfy-js","cosmology-tech/strfy-js"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fstrfy-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fstrfy-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fstrfy-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperweb-io%2Fstrfy-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperweb-io","download_url":"https://codeload.github.com/hyperweb-io/strfy-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356193,"owners_count":19788513,"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":"2025-02-23T18:17:45.531Z","updated_at":"2025-10-12T19:10:11.485Z","avatar_url":"https://github.com/hyperweb-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strfy-js\n\n## Stringify JSON as JavaScript 🌴\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n  \u003ca href=\"https://github.com/pyramation/strfy-js/actions/workflows/run-tests.yaml\"\u003e\n    \u003cimg height=\"20\" src=\"https://github.com/pyramation/strfy-js/actions/workflows/run-tests.yaml/badge.svg\" /\u003e\n  \u003c/a\u003e\n   \u003ca href=\"https://github.com/pyramation/strfy-js/blob/main/LICENSE-MIT\"\u003e\u003cimg height=\"20\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`strfy-js` is a custom JavaScript serialization library designed to extend the capabilities of JSON serialization. This library is particularly useful for generating JavaScript objects directly from JSON, enabling developers to work with JSON data more effectively within JavaScript environments.\n\n## Features\n\n- **🛠️ Extended Serialization**: Converts JSON to JavaScript objects, supporting output, such as properties without quotes, not typically handled by standard JSON. \n\n- **⚙️ Customizable**: Offers various options to customize the output, making it suitable for different use cases. Tailor the serialization process to meet your specific requirements.\n\n- **⚡ Lightweight and Fast**: Optimized for performance, making it a practical choice for applications that require fast serialization of large amounts of data. Ideal for handling high-load environments efficiently.\n\n## Installation\n\nTo install `strfy-js`, use npm or yarn:\n\n```bash\nnpm install strfy-js\n# or\nyarn add strfy-js\n``` \n\n## Usage\n\nImport `jsStringify` from `strfy-js` and use it to serialize JavaScript objects:\n\n```js\nimport { jsStringify } from 'strfy-js';\n\nconst obj = {\n  \"$schema\": \"schema.json\",\n  \"chain_id\": \"cosmos-1\",\n  \"logo_URIs\": {\n    \"png\": \"cosmos.png\"\n  },\n  \"binaries\": {\n    \"linux/amd64\": \"cosmos-bin.tar.gz\"\n  }\n};\n\nconst options = {\n    space: 2,\n    camelCase: true,\n    quotes: 'single'\n};\n\nconsole.log(jsStringify(obj, options));\n// OUTPUT:\n{\n  $schema: 'schema.json',\n  chainId: 'cosmos-1',\n  logoURIs: {\n    png: 'cosmos.png'\n  },\n  binaries: {\n    \"linux/amd64\": 'cosmos-bin.tar.gz'\n  }\n}\n```\n\n## Options\n\n`jsStringify` accepts the following options in the `StringifyOptions` interface:\n\n- `space` (optional): Specifies the number of spaces to use for indentation, defaults to `0`.\n- `replacer` (optional): A function that alters the behavior of the stringification process by filtering and transforming the values.\n- `quotes` (optional): Determines the type of quotes around strings. Can be `'single'`, `'double'`, or determined automatically to avoid escapes.\n- `inlineArrayLimit` (optional): Allows arrays to be serialized inline if they have fewer elements than the specified limit.\n- `camelCase` (optional): When set to `true`, object keys are transformed into camelCase.\n- `camelCaseFn` (optional): A custom function that can be provided to convert object keys into camelCase using a custom transformation logic.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your enhancements. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperweb-io%2Fstrfy-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperweb-io%2Fstrfy-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperweb-io%2Fstrfy-js/lists"}