{"id":21592954,"url":"https://github.com/jonabrams/pieceful","last_synced_at":"2025-04-10T23:27:03.524Z","repository":{"id":57324002,"uuid":"53815216","full_name":"JonAbrams/pieceful","owner":"JonAbrams","description":"A very simple library for connecting your HTML with your JavaScript.","archived":false,"fork":false,"pushed_at":"2016-03-27T21:24:21.000Z","size":12,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T19:05:10.535Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JonAbrams.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":"2016-03-14T00:23:34.000Z","updated_at":"2025-03-14T15:31:36.000Z","dependencies_parsed_at":"2022-09-09T09:21:46.736Z","dependency_job_id":null,"html_url":"https://github.com/JonAbrams/pieceful","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/JonAbrams%2Fpieceful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonAbrams%2Fpieceful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonAbrams%2Fpieceful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonAbrams%2Fpieceful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonAbrams","download_url":"https://codeload.github.com/JonAbrams/pieceful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248313974,"owners_count":21082957,"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-24T17:10:38.504Z","updated_at":"2025-04-10T23:27:03.505Z","avatar_url":"https://github.com/JonAbrams.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PiecefulJS\n\n[![Build Status](https://travis-ci.org/JonAbrams/pieceful.svg?branch=master)](https://travis-ci.org/JonAbrams/pieceful)\n\nA very simple library for connecting your HTML with your JavaScript.\n\nWhen Backbone, Angular, and React are overkill, add a tad of structure to your code using components, made up of pieces.\n\nFeatures:\n- Modularize your JS into components.\n- Add structure by breaking components into \"pieces\".\n- Easily declare event listeners.\n- Makes use of jQuery if available, but it's not required.\n- No external dependencies.\n- Compatible with IE9+ and all other modern browsers.\n\n## Usage Example\n\n```html\n\u003cform data-component=\"terms\"\u003e\n  Do you agree to the terms and conditions?\n  \u003cinput type=\"checkbox\" data-piece=\"termCheckbox\"\u003e\n  \u003cbutton type=\"submit\" data-piece=\"termSubmit\"\u003eSign Up\u003c/button\u003e\n\u003c/form\u003e\n\n\u003cscript\u003e\n  component('terms', {\n    pieces: ['termCheckbox', 'termSubmit'],\n    events: {\n      termCheckbox: {\n        click: 'toggleSubmit'\n      }\n    },\n    init: function () {\n      this.termSubmit.disabled = true;\n      /* or with jQuery available: */\n      this.$termSubmit.attr('disabled', true);\n    },\n    toggleSubmit: function (event) {\n      this.termSubmit.disabled = !event.target.checked;\n    }\n  });\n\u003c/script\u003e\n```\n\n## Installation\n\n`npm install pieceful`\n\nThen load `peaceful.js` onto your web site however you like. It provides a single global function: `component`.\n\n## Credits\n\nCreated by [Jon Abrams](https://twitter.com/JonathanAbrams)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonabrams%2Fpieceful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonabrams%2Fpieceful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonabrams%2Fpieceful/lists"}