{"id":30294429,"url":"https://github.com/linkedin/spaniel","last_synced_at":"2025-08-17T01:34:54.595Z","repository":{"id":12580115,"uuid":"69604542","full_name":"linkedin/spaniel","owner":"linkedin","description":"LinkedIn's JavaScript viewport tracking library and IntersectionObserver polyfill","archived":false,"fork":false,"pushed_at":"2024-05-13T22:02:23.000Z","size":1908,"stargazers_count":92,"open_issues_count":22,"forks_count":33,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-20T06:34:35.564Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkedin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-29T20:18:52.000Z","updated_at":"2024-08-23T19:13:23.000Z","dependencies_parsed_at":"2024-05-13T23:24:29.783Z","dependency_job_id":"7023b86e-5ce6-4c47-adc3-b858a840fa4e","html_url":"https://github.com/linkedin/spaniel","commit_stats":{"total_commits":147,"total_committers":15,"mean_commits":9.8,"dds":0.2108843537414966,"last_synced_commit":"510679b99b8aae790e5f2d7abf3cffa84bf410bf"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/linkedin/spaniel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fspaniel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fspaniel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fspaniel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fspaniel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkedin","download_url":"https://codeload.github.com/linkedin/spaniel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2Fspaniel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270796216,"owners_count":24647319,"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-16T02:00:11.002Z","response_time":91,"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":[],"created_at":"2025-08-17T01:34:53.986Z","updated_at":"2025-08-17T01:34:54.572Z","avatar_url":"https://github.com/linkedin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spaniel [![Build Status](https://travis-ci.org/linkedin/spaniel.svg?branch=master)](https://travis-ci.org/linkedin/spaniel) [![npm version](https://badge.fury.io/js/spaniel.svg)](https://www.npmjs.com/package/spaniel)\n\nLinkedIn's JavaScript viewport tracking library and [IntersectionObserver](https://github.com/WICG/IntersectionObserver) polyfill. Track what the user actually sees.\n\n```JavaScript\nimport { IntersectionObserver } from 'spaniel';\n\nnew IntersectionObserver((entries) =\u003e { console.log('I see you') }, {\n  threshold: 0.5\n}).observe(document.getElementById('my-element'));\n```\n\nPractical uses included:\n\n* Determining advertisement impressions\n* Impression discounting feedback for relevance systems\n* Occlusion culling - Don't render an object until user is close to scrolling the object into the viewport\n\n## [Usage and API Docs](https://linkedin.github.io/spaniel/)\n\nSpaniel provides additional abstractions on top of [IntersectionObserver](https://github.com/WICG/IntersectionObserver), provides APIs for hooking into the low-level internals, and has some limitations as a non-complete polyfill. Learn more by reading the [Usage and API Docs](https://linkedin.github.io/spaniel/).\n\n## Why use Spaniel?\n\n* Provides the future-proofing of a WICG API, but with an expanded feature-set built upon said API.\n* Tested and iterated upon in production by LinkedIn since late 2014\n* Highly performant, only relies on `requestAnimationFrame`\n* Extensive `requestAnimationFrame` task/utility API\n\n#### How is it tested?\n\nSpaniel has both unit tests and a headless test suite. The headless tests are run using [Nightmare](https://github.com/segmentio/nightmare).\n\n#### How big is Spaniel?\n\nCheckout [size.txt](https://github.com/linkedin/spaniel/blob/gh-pages/size.txt) to see the current minified UMD gzipped size.\n\nYou can also run `npm run stats` to measure locally.\n\n## Installation\n\nSpaniel is a standard NPM/CommonJS module. You can use a build tool like [browserify](http://browserify.org/) or [webpack](https://www.npmjs.com/package/webpack) to include Spaniel in your application.\n\nIf you're using [rollup](http://rollupjs.org/), an ES6 version is built at `/exports/es6/spaniel.js` (as noted by `jsnext:main` in `package.json`).\n\nAlternatively, running *npm run build* will generate a UMD file at `/exports/spaniel.js`, and a minified UMD file at `/exports/min/spaniel.js`. You can use the minified file in production.\n\n## Development setup\nThe Spaniel source code is written in [TypeScript](https://www.typescriptlang.org/).\n\nYou will need `testem` installed globally to run the tests.\n\n```\nnpm install -g testem\n```\n\nYou will also need to install [phantom.js](http://phantomjs.org/download.html) globally.\n\n```\n// Install dependencies\nnpm install\n\n// Run build\nnpm run build\n\n// Watch and auto-rebuild\nnpm run watch\n\n// Serve test app\nnpm run serve\n\n// Run the tests\nnpm run test\n```\n\n## IntersectionObserver Resources\n\n* [https://github.com/WICG/IntersectionObserver](https://github.com/WICG/IntersectionObserver)\n* [https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)\n\n## Copyright\n\nCopyright 2017 LinkedIn Corp.  All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkedin%2Fspaniel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkedin%2Fspaniel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkedin%2Fspaniel/lists"}