{"id":22287448,"url":"https://github.com/fooker/constructjs","last_synced_at":"2025-03-25T20:46:39.545Z","repository":{"id":138424556,"uuid":"6404669","full_name":"fooker/constructjs","owner":"fooker","description":"Library for creating arbitrary JavaScript structures and JSON from templates","archived":false,"fork":false,"pushed_at":"2012-10-26T20:26:07.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T18:29:29.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fooker.png","metadata":{"files":{"readme":"README","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":"2012-10-26T14:07:22.000Z","updated_at":"2013-10-06T22:27:30.000Z","dependencies_parsed_at":"2023-03-13T10:54:03.674Z","dependency_job_id":null,"html_url":"https://github.com/fooker/constructjs","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/fooker%2Fconstructjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooker%2Fconstructjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooker%2Fconstructjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooker%2Fconstructjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fooker","download_url":"https://codeload.github.com/fooker/constructjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245543199,"owners_count":20632637,"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-12-03T17:00:01.620Z","updated_at":"2025-03-25T20:46:39.519Z","avatar_url":"https://github.com/fooker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"General Information\n===================\n\nconstruct.js is a JSON prototyping system for coffeescript/javascript. It allows\nto generate arbitrary JSON structures from a templat.\n\nconstruct.js allows to intermix JSON structures with logical elements using\nfunctions. If the template is evaluated, all functions contained in the template\nare called and the function is replaced by its return value.\n\nAdditionaly construct.js provides a set of usefull helper functions which can be\nused in the templates.\n\n\n\nInstallation\n============\n\nInclude the file js/construct.js in your application.\n\n\n\nUsage\n=====\n\nYou can use the cs command to create a construct.js template. The structure\npassed to the cs command is used as the template:\n\n tpl = cs {\n   'foo' : 42\n   'bar' : () -\u003e 23\n }\n\nThe template can be transaformed into a real structure by calling the cs object:\n\n tpl = cs {\n   'bar' : () -\u003e 23\n }\n\n result = tpl()\n # result now contains the evaluated structure: { 'bar' : 23 }\n\nThe helper functions allows to put some logic into the template:\n\n tpl = cs {\n   'bar' : cs.if (() -\u003e true), {\n     'foo' : 23\n   }, {\n     'bar' : 42\n   }\n\n result = tpl()\n# result now contains the evaluated structure: { 'foo' : 23 }\n\n\n\nHow to report bugs\n==================\n\nBugs should reported to the author at \u003cdustin.frisch@gmail.com\u003e or using the\nbug-tracker at https://github.com/fooker/constructjs/issues.\n\nIn the bug report please include:\n\n* Information about your system. For instance:\n\n  - What operating system and version\n  - What version of Apache / LightTPD \n  - What version of python\n\n  And anything else you think is relevant.\n\n* How to reproduce the bug. \n\n  Please include a short test that exhibits the behavior. As a last resort, you\n  can also provide a pointer to a larger installation that can be\n  downloaded.\n\n* If the bug was a crash, the exact text that was printed out when the\n  crash occured.\n\n* Further information such as stack traces may be useful, but is not\n  necessary.\n\n\n\nPatches\n=======\n\nPatches should also be submitted the author at \u003cdustin.frisch@gmail.com\u003e or\nusing git pull requests using https://github.com/. If the patch fixes an\nexisting bug, add the patch as an attachment to that bug report.\n\nOtherwise, enter a new bug report that describes the patch, and attach\nthe patch to that bug report.\n\nPatches should be in unified diff form. (The -up option to GNU diff.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffooker%2Fconstructjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffooker%2Fconstructjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffooker%2Fconstructjs/lists"}