{"id":15369139,"url":"https://github.com/developit/picolib","last_synced_at":"2026-02-14T18:02:06.152Z","repository":{"id":7225905,"uuid":"8533804","full_name":"developit/picolib","owner":"developit","description":"Slimey, yet... satisfying.","archived":false,"fork":false,"pushed_at":"2013-03-03T09:42:39.000Z","size":112,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T18:33:01.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developit.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-03T08:33:53.000Z","updated_at":"2023-09-25T07:44:06.000Z","dependencies_parsed_at":"2022-08-26T16:51:04.518Z","dependency_job_id":null,"html_url":"https://github.com/developit/picolib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/developit/picolib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpicolib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpicolib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpicolib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpicolib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/picolib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fpicolib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29451918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-01T13:34:23.357Z","updated_at":"2026-02-14T18:02:06.134Z","avatar_url":"https://github.com/developit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"What is This Crap?\n==================\nIt's a JavaScript library that helps you do things 4% faster on average*\n\n*...ok, I made that up. Really its only \"feature\" is being small.\n\n\nWord of Warning\n===============\nThe code sort-of reminds me of a bookmarklet. Take from that what you will.\nFeel free to do whatever you please with this, I don't really use it anymore.\n\n\nShow me Some Functions\n======================\n\n\nUtilities\n---------\n\n# `picolib.isArray(obj)`\n*Check if the given value is an Array*\n\u003e Returns `true` if `obj` is an Array, otherwise `false`.\n\n\n# `picolib.extend(obj, props)`\n*Extend one object with the properties of another*\n\u003e `obj`: An object to copy properties to.\n\u003e\n\u003e `props`: An object whose properties should be copied.\n\n\n# `picolib.keys(obj)`\n*Get an Array of the given object's keys*\n\u003e same as Object.keys()\n\n\n# `picolib.each(obj, fn, ctx)`\n*Iterate over the values of an Object or Array*\n\u003e `obj`: An Object or Array to iterate over.\n\u003e \n\u003e `fn`: A function to call on each item. Gets passed `(item, key)`. Return false to break out of the loop.\n\u003e \n\u003e `ctx`: Context object, gets set as the value of `this` inside `fn`. Defaults to `obj`.\n\n\n# `picolib.map(obj, fn, state)`\n*Iterate over the items in a collection to get aggregate or filtered information.*\n\u003e\n\u003e `obj`: An Object or Array to iterate over.\n\u003e\n\u003e `fn`: A function to call on each item. Gets passed `(item, key, state)`.\n\u003e\n\u003e `state`: An Object to hold state, whose properties can be modified on each iteration.\n\n# `picolib.bind(fn, context)`\n*Bind a function to the given context*\n\u003e `fn`: A function. When bound, the value of `this` inside `fn` will always be `context`.\n\u003e\n\u003e `context`: An object to bind as the context for `fn`.\n\n# `fn.unbind()`\n*Unbind - reverse bind()*\n\u003e Call this on a function returned from `bind()` to revert it back to standard JavaScript behaviour.\n\n\nDOM\n---\n\n# `picolib.create(def, insertInto)`\n*Create a DOM node (or tree) from an Object definition*\n\u003e `def.type`: The node type (tag name) to create.\n\u003e\n\u003e `def.attrs`: key-value attributes to apply.\n\u003e\n\u003e `def.props`: key-value properties to set.\n\u003e\n\u003e `def.css`: CSStext to apply.\n\u003e\n\u003e `def.children`: Array of child definitions. Can be infinitely nested.\n\u003e\n\u003e `def.insertBefore`: Optionally insert the node before a node.\n\u003e\n\u003e `insertInto`: A parent node to insert the new node into.\n\n# `picolib.el(id)`\n*Get an element by its ID*\n\n# `picolib.hide(el)`\n*Hide an element*\n\u003e `el`: An element, or an ID.\n\n# `picolib.show(el)`\n*Show an element*\n\u003e `el`: An element, or an ID.\n\n# `picolib.handle(el, type, handler)`\n*Register an event handler on an element*\n\u003e `el`: An element to register the handler on.\n\u003e\n\u003e `type`: An event type to listen for. 'on'-prefixes get stripped.\n\u003e\n\u003e `handler`: Function to call when the event is triggered.\n\n# `picolib.unhandle(el, type, handler)`\n*Unregister an event handler from an element*\n\u003e `el`: The element to unregister the handler from.\n\u003e\n\u003e `type`: The event type of the handler being unregistered.\n\u003e\n\u003e `handler`: The handler function to remove.\n\n\n\nJSONp\n-----\n# `picolib.jsonp(url, callback [, callbackId])`\n*Make a JSONp Request*\n\u003e `url`: The URL to request. Tell jsonp where to stick the callback ID with the \"{callback}\" field.\n\u003e\n\u003e `callback`: A function to call when done. Gets passed the data.\n\u003e\n\u003e `callbackId`: Instead of generating a callback ID, manually sets it.\n\n\nJSON\n----\n# `picolib.json.parse(str)`\n*Parse a JSON String*\n\n# `picolib.json.stringify(obj)`\n*Serialize to a JSON String*\n\n\nXML\n---\n# `picolib.xml.parse(str)`\n*Parse XML*\n\u003e Returns a DOM Document\n\n\nQueryStrings\n------------\n# `picolib.qs.parse(str)`\n**Parse a querystring**\n\u003e Returns key-value pairs as an Object\n\n# `picolib.qs.stringify(obj)`\n**Build a querystring**\n\u003e `obj`: An object with key-value querystring parameter pairs\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fpicolib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fpicolib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fpicolib/lists"}