{"id":30060296,"url":"https://github.com/tiaanduplessis/pika","last_synced_at":"2025-08-08T01:43:41.845Z","repository":{"id":57166442,"uuid":"96937413","full_name":"tiaanduplessis/pika","owner":"tiaanduplessis","description":"Efficient DOM element selection in 427 bytes (gzipped)","archived":false,"fork":false,"pushed_at":"2019-11-21T10:27:34.000Z","size":98,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-11T00:52:12.802Z","etag":null,"topics":["dom","elements","selector"],"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/tiaanduplessis.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":"2017-07-11T21:09:47.000Z","updated_at":"2022-05-30T09:47:20.000Z","dependencies_parsed_at":"2022-08-30T15:10:19.191Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/pika","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/pika","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fpika","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fpika/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fpika/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fpika/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/pika/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fpika/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352257,"owners_count":24402672,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dom","elements","selector"],"created_at":"2025-08-08T01:43:38.195Z","updated_at":"2025-08-08T01:43:41.811Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"JavaScript","readme":"# pika\n\n\u003e Efficient DOM element selection in 427 bytes (gzipped)\n\n[![npm package version](https://img.shields.io/npm/v/@tiaanduplessis/pika.svg?style=flat-square)](https://npmjs.org/package/@tiaanduplessis/pika)\n[![npm downloads](https://img.shields.io/npm/dm/@tiaanduplessis/pika.svg?style=flat-square)](https://npmjs.org/package/@tiaanduplessis/pika)\n[![standard JS linter](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n[![Greenkeeper](https://badges.greenkeeper.io/tiaanduplessis/pika.svg)](https://greenkeeper.io)\n[![travis ci build status](https://img.shields.io/travis/tiaanduplessis/pika.svg?style=flat-square)](https://travis-ci.org/tiaanduplessis/pika)\n[![project license](https://img.shields.io/npm/l/@tiaanduplessis/pika.svg?style=flat-square)](https://github.com/tiaanduplessis/pika/blob/master/LICENSE)\n[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Contribute](contribute)\n- [License](#license)\n\n## Install\n\n```sh\n$ npm install @tiaanduplessis/pika\n# OR\n$ yarn add @tiaanduplessis/pika\n```\n\n## Usage\n\nThe most relevant method for locating a DOM element will be chosen, because some times [`document.querySelector` won't do](https://jsperf.com/getelementbyid-vs-queryselector-vs-queryselector-by-id):\n\n```js\nimport pika from '@tiaanduplessis/pika'\n\npika('body') // document.body\npika('head') // document.head\npika('#foo') // document.getElementById\npika('.foo') // document.getElementsByClassName\npika('div') // document.getElementsByTagName\npika('[value]') // document.querySelectorAll\n\n```\n\nYou can optionally specify your own context(defaults to `document`):\n\n```js\n\n// find span within #foo\npika('span', { context: pika('#foo') })\n\n```\n\nIf the `first` option is specified and their is only one element that matches the selector, that element will be returned instead of a array.\n\n## Contributing\n\nContributions are welcome!\n\n1. Fork it.\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\nOr open up [a issue](https://github.com/tiaanduplessis/pika/issues).\n\n## License\n\nLicensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fpika","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Fpika","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fpika/lists"}