{"id":14384823,"url":"https://github.com/choojs/nanotask","last_synced_at":"2025-08-23T18:30:51.169Z","repository":{"id":57308041,"uuid":"87241691","full_name":"choojs/nanotask","owner":"choojs","description":"Microtask queue scheduler for the browser","archived":false,"fork":false,"pushed_at":"2018-06-03T11:48:00.000Z","size":9,"stargazers_count":49,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T15:45:10.657Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/choojs.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-04-04T22:38:35.000Z","updated_at":"2025-06-29T13:17:02.000Z","dependencies_parsed_at":"2022-09-12T11:44:34.190Z","dependency_job_id":null,"html_url":"https://github.com/choojs/nanotask","commit_stats":null,"previous_names":["yoshuawuyts/nanotask"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/choojs/nanotask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choojs%2Fnanotask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choojs%2Fnanotask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choojs%2Fnanotask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choojs%2Fnanotask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/choojs","download_url":"https://codeload.github.com/choojs/nanotask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choojs%2Fnanotask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271762766,"owners_count":24816823,"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-23T02:00:09.327Z","response_time":69,"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":"2024-08-28T18:01:42.107Z","updated_at":"2025-08-23T18:30:50.838Z","avatar_url":"https://github.com/choojs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# nanotask [![stability][0]][1]\n[![npm version][2]][3] [![build status][4]][5]\n[![downloads][8]][9] [![js-standard-style][10]][11]\n\nMicrotask queue scheduler for the browser. Falls back to\n`window.requestAnimationFrame` in environments that don't allow\n`MutationObserver` based scheduling.\n\nThe microtask queue is a set of tasks that runs at the end of the current frame\nin the browser, before recalculating style and painting. This is analogous to\n`process.nextTick()` in Node. There's no direct API for the microtask queue in\nthe browser, but using `document.MutationObserver` we can trick the browser\ninto running functions as part of the microtask queue. This is useful to create\ntight, 60fps loops in the main browser thread.\n\n## Usage\n```js\nvar nanotask = require('nanotask')\nvar queue = nanotask()\n\nqueue(function () {\n  console.log('resolved at the start of the next frame')\n})\n```\n\n## API\n### `queue = nanotask()`\nCreate a new Nanotask instance.\n\n### `queue(fn)`\nQueue a function on the browser's microtask queue.\n\n## Installation\n```sh\n$ npm i nanotask\n```\n\n## License\n[MIT](https://tldrlegal.com/license/mit-license)\n\n[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square\n[1]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[2]: https://img.shields.io/npm/v/nanotask.svg?style=flat-square\n[3]: https://npmjs.org/package/nanotask\n[4]: https://img.shields.io/travis/yoshuawuyts/nanotask/master.svg?style=flat-square\n[5]: https://travis-ci.org/yoshuawuyts/nanotask\n[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/nanotask/master.svg?style=flat-square\n[7]: https://codecov.io/github/yoshuawuyts/nanotask\n[8]: http://img.shields.io/npm/dm/nanotask.svg?style=flat-square\n[9]: https://npmjs.org/package/nanotask\n[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[11]: https://github.com/feross/standard\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoojs%2Fnanotask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchoojs%2Fnanotask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoojs%2Fnanotask/lists"}