{"id":17283734,"url":"https://github.com/prettymuchbryce/imp","last_synced_at":"2025-04-14T10:20:44.145Z","repository":{"id":10276760,"uuid":"12391698","full_name":"prettymuchbryce/imp","owner":"prettymuchbryce","description":"Interfaces in JavaScript.","archived":false,"fork":false,"pushed_at":"2013-09-04T20:56:05.000Z","size":108,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T16:56:59.863Z","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/prettymuchbryce.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":"2013-08-26T23:07:35.000Z","updated_at":"2024-11-28T16:27:47.000Z","dependencies_parsed_at":"2022-09-22T11:03:08.494Z","dependency_job_id":null,"html_url":"https://github.com/prettymuchbryce/imp","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/prettymuchbryce%2Fimp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fimp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fimp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fimp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettymuchbryce","download_url":"https://codeload.github.com/prettymuchbryce/imp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860005,"owners_count":21173343,"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-10-15T09:52:05.993Z","updated_at":"2025-04-14T10:20:44.125Z","avatar_url":"https://github.com/prettymuchbryce.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imp.js  \n\u003e Interfaces in JavaScript.\n\n#### About \n\nInterfaces are a common OOP tool in languages like Java. Imp offers a solution for using interfacing in Javascript. Imp checks method names, and parameter names. Imp throws runtime errors if your classes fail to properly implement their interfaces. \n\n#### Defining an interface\n\n\tvar IAnimal = \n\t{\n  \t\t\"methods\": [ \n    \t\t{ \"name\" : \"makeSound\", \"params\": [\"sound\"] },\n    \t\t{ \"name\" : \"isMammal\" },\n    \t\t{ \"name\" : \"isDomestic\" }\n  \t\t]\n\t}\n    \n#### Ensuring a class implements this interface\n\n\tvar Dog = function() {\n \t\tImp.lements(IAnimal, this);\n\t\t\t\t\n  \t\tthis.makeSound = function(sound) {\n    \t\t\tconsole.log(\"Woof!\" + sound);\n  \t\t};\n  \n  \t\tthis.isMammal = function() {\n    \t\t\treturn true;\n  \t\t};\n\n  \t\tthis.isDomestic = function() {\n    \t\t\treturn true;\n  \t\t};\n\t};\n    \n#### API Recap\n\n`Imp.lements(interfaceReference, implementation);`\n\n`Imp.doesImplement(interfaceReference, implementation);`\n\n`Imp.setProductionMode(); //Remove interface enforcement and console errors.`\n\n## Want to learn more?\n\n_Find the minified file in the bin directory._\n\n**See example.html for a more robust example**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Fimp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettymuchbryce%2Fimp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Fimp/lists"}