{"_id":"@byojs/toggler","_rev":"5-ed5a15ee48ecddc9e56f9c2dbfa8515a","name":"@byojs/toggler","dist-tags":{"latest":"0.1.4"},"versions":{"0.0.9":{"name":"@byojs/toggler","version":"0.0.9","keywords":["debounce","throttle","toggle","scheduling","task","async"],"author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","_id":"@byojs/toggler@0.0.9","maintainers":[{"name":"getify","email":"getify@gmail.com"}],"homepage":"https://github.com/byojs/toggler","bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"dist":{"shasum":"e933516ca70ef4f5f79609a96b61c5e000b11776","tarball":"https://registry.npmjs.org/@byojs/toggler/-/toggler-0.0.9.tgz","fileCount":12,"integrity":"sha512-wLXTLfLE1jV+c2qlBcZaqc5S3NikF8JlPUOVvFPazUyg58IuorWtYaqq+r+aUj7hAPkeMhmzuVHfs5iftMkSpQ==","signatures":[{"sig":"MEUCIFtXz7zYeV5mVK3hFv+qTGSJBTlHFKSycgQVauNlF0dcAiEAj18nhc5VIOXIerY1Sf9zS+WDQG+XQaeKZ0gIQhCHhcg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24430},"browser":{"@byojs/toggler":"./dist/toggler.mjs"},"exports":{"./":"./dist/toggler.mjs"},"gitHead":"c5181d53658a020e6c8cbbdf6836c98a7b87c0e4","scripts":{"test":"npm run test:start","build":"npm run build:all","build:all":"node scripts/build-all.js","test:start":"npx http-server test/ -p 8080","postinstall":"node scripts/postinstall.js","build:gh-pages":"npm run build:all && node scripts/build-gh-pages.js","prepublishOnly":"npm run build:all"},"_npmUser":{"name":"getify","email":"getify@gmail.com"},"repository":{"url":"git+https://github.com/byojs/toggler.git","type":"git"},"_npmVersion":"10.8.2","description":"Throttled toggler","directories":{},"_nodeVersion":"21.7.2","dependencies":{"@byojs/scheduler":"~0.9.1"},"_hasShrinkwrap":false,"devDependencies":{"terser":"~5.31.6","micromatch":"~4.0.8","recursive-readdir-sync":"~1.0.6"},"_npmOperationalInternal":{"tmp":"tmp/toggler_0.0.9_1725393781972_0.6199616970140389","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@byojs/toggler","version":"0.1.0","keywords":["debounce","throttle","toggle","scheduling","task","async"],"author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","_id":"@byojs/toggler@0.1.0","maintainers":[{"name":"getify","email":"getify@gmail.com"}],"homepage":"https://github.com/byojs/toggler","bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"dist":{"shasum":"069fb83b0897bf8885f85bd7a1de42f73060f26c","tarball":"https://registry.npmjs.org/@byojs/toggler/-/toggler-0.1.0.tgz","fileCount":12,"integrity":"sha512-GsZUiV19kRE2NDASLw8w4EQHVwg+VLwPpR3/lD4aTNP9H1VNLply+V5VwALrKz6omHExxFrvWyoajRwbtjMcvQ==","signatures":[{"sig":"MEYCIQDm5sqrpmWz+wE5fr5oWanU+Us305RxdRb5a5MdNWT/3gIhAP01K7bQhsDRcdJBhfX4jK7KaTuNzjP9kB/JamDmj7qi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24466},"browser":{"@byojs/toggler":"./dist/toggler.mjs"},"exports":{"./":"./dist/toggler.mjs"},"gitHead":"3a9ea9038f1c90693b0d53a8854523afa7750256","scripts":{"test":"npm run test:start","build":"npm run build:all","build:all":"node scripts/build-all.js","test:start":"npx http-server test/ -p 8080","postinstall":"node scripts/postinstall.js","build:gh-pages":"npm run build:all && node scripts/build-gh-pages.js","prepublishOnly":"npm run build:all"},"_npmUser":{"name":"getify","email":"getify@gmail.com"},"repository":{"url":"git+https://github.com/byojs/toggler.git","type":"git"},"_npmVersion":"10.8.2","description":"Throttled toggler","directories":{},"_nodeVersion":"21.7.2","dependencies":{"@byojs/scheduler":"~0.9.1"},"_hasShrinkwrap":false,"devDependencies":{"terser":"~5.31.6","micromatch":"~4.0.8","recursive-readdir-sync":"~1.0.6"},"_npmOperationalInternal":{"tmp":"tmp/toggler_0.1.0_1725404321816_0.14735801329480935","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@byojs/toggler","version":"0.1.1","keywords":["debounce","throttle","toggle","scheduling","task","async"],"author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","_id":"@byojs/toggler@0.1.1","maintainers":[{"name":"getify","email":"getify@gmail.com"}],"homepage":"https://github.com/byojs/toggler","bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"dist":{"shasum":"85d0702efc83a878ebf09fcb20b91756c8d86ee5","tarball":"https://registry.npmjs.org/@byojs/toggler/-/toggler-0.1.1.tgz","fileCount":12,"integrity":"sha512-K+go2p1HZWxWfbSOx1dpWmTjqU6Bn4Gh4U496koQddvfb9tPex8mHpZUnRp79lMXDvvO1/Y0iN8axFDdeH7J6A==","signatures":[{"sig":"MEUCIFatGJQna8Gj60ay48kXp1ZutH5qQYhetBPnIgLaarn8AiEA5buiMpXRvRE5bajk3RC9Wl8nrUe9ztp/MKbtvdKSi/8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25583},"browser":{"@byojs/toggler":"./dist/toggler.mjs"},"exports":{"./":"./dist/toggler.mjs"},"gitHead":"1e77a790168ec7e6bbf2099b913464e8a3e9c5b1","scripts":{"test":"npm run test:start","build":"npm run build:all","build:all":"node scripts/build-all.js","test:start":"npx http-server test/ -p 8080","postinstall":"node scripts/postinstall.js","build:gh-pages":"npm run build:all && node scripts/build-gh-pages.js","prepublishOnly":"npm run build:all"},"_npmUser":{"name":"getify","email":"getify@gmail.com"},"repository":{"url":"git+https://github.com/byojs/toggler.git","type":"git"},"_npmVersion":"10.8.2","description":"Throttled toggler","directories":{},"_nodeVersion":"21.7.2","dependencies":{"@byojs/scheduler":"~0.9.1"},"_hasShrinkwrap":false,"devDependencies":{"terser":"~5.31.6","micromatch":"~4.0.8","recursive-readdir-sync":"~1.0.6"},"_npmOperationalInternal":{"tmp":"tmp/toggler_0.1.1_1725639727660_0.5722607532593793","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@byojs/toggler","version":"0.1.2","keywords":["debounce","throttle","toggle","scheduling","task","async"],"author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","_id":"@byojs/toggler@0.1.2","maintainers":[{"name":"getify","email":"getify@gmail.com"}],"homepage":"https://github.com/byojs/toggler","bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"dist":{"shasum":"6f9db45e9d293a30a7585fe6ce7a1352820d173e","tarball":"https://registry.npmjs.org/@byojs/toggler/-/toggler-0.1.2.tgz","fileCount":12,"integrity":"sha512-RuBHudOq5rKqJXVQvB5y0lhD7Qm3dghS1+T9UUyChPvBsDZm4jmYGebcsZfo0cvECJA3a17ubLqd/7IKUDE/Nw==","signatures":[{"sig":"MEUCIQCPitTUORo+8KsGAUfJdxGswh+ePy8q3b/0JJtCZCM8AwIgNbfiu/mzGfPSUdnH2RAs+UolCDCc+DLerE/f9KIY48U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25595},"browser":{"@byojs/toggler":"./dist/toggler.mjs"},"exports":{"./":"./dist/toggler.mjs"},"gitHead":"0023cc8d05e3d5a097420e9ce0b1e88903fb1320","scripts":{"test":"npm run test:start","build":"npm run build:all","build:all":"node scripts/build-all.js","test:start":"npx http-server test/ -p 8080","postinstall":"node scripts/postinstall.js","build:gh-pages":"npm run build:all && node scripts/build-gh-pages.js","prepublishOnly":"npm run build:all"},"_npmUser":{"name":"getify","email":"getify@gmail.com"},"repository":{"url":"git+https://github.com/byojs/toggler.git","type":"git"},"_npmVersion":"10.8.2","description":"Throttled toggler","directories":{},"_nodeVersion":"21.7.2","dependencies":{"@byojs/scheduler":"~0.9.2"},"_hasShrinkwrap":false,"devDependencies":{"terser":"~5.31.6","micromatch":"~4.0.8","recursive-readdir-sync":"~1.0.6"},"_npmOperationalInternal":{"tmp":"tmp/toggler_0.1.2_1726361280706_0.4621644254596271","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@byojs/toggler","version":"0.1.3","keywords":["debounce","throttle","toggle","scheduling","task","async"],"author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","_id":"@byojs/toggler@0.1.3","maintainers":[{"name":"getify","email":"getify@gmail.com"}],"homepage":"https://github.com/byojs/toggler","bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"dist":{"shasum":"aac84397c09542c2941df9120d03908bc560f204","tarball":"https://registry.npmjs.org/@byojs/toggler/-/toggler-0.1.3.tgz","fileCount":12,"integrity":"sha512-7IShlr32/3E0WOyu9R3N6tyBB470+h57p2hHQkBHccKuGT1qibgxy3ePN+/AVFe9Q/pC5SiMuOA/SDWBpHhUBg==","signatures":[{"sig":"MEUCIQClKZaL360tXGqcmoyikOlNAqjnzpr6EBlZjCwZUCtbRQIgaUaFKPhUgGxonXH59zmB8nPaiMctPR1JSANjl+YeXTg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25595},"browser":{"@byojs/toggler":"./dist/toggler.mjs"},"exports":{"./":"./dist/toggler.mjs"},"gitHead":"28a422f37cd49dbbb1fbea4f2ee70f60121a02ee","scripts":{"test":"npm run test:start","build":"npm run build:all","build:all":"node scripts/build-all.js","test:start":"npx http-server test/ -p 8080","postinstall":"node scripts/postinstall.js","build:gh-pages":"npm run build:all && node scripts/build-gh-pages.js","prepublishOnly":"npm run build:all"},"_npmUser":{"name":"getify","email":"getify@gmail.com"},"repository":{"url":"git+https://github.com/byojs/toggler.git","type":"git"},"_npmVersion":"10.8.2","description":"Throttled toggler","directories":{},"_nodeVersion":"21.7.2","dependencies":{"@byojs/scheduler":"~0.9.3"},"_hasShrinkwrap":false,"devDependencies":{"terser":"~5.37.0","micromatch":"~4.0.8","recursive-readdir-sync":"~1.0.6"},"_npmOperationalInternal":{"tmp":"tmp/toggler_0.1.3_1738709487252_0.2926011903300765","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@byojs/toggler","description":"Throttled toggler","version":"0.1.4","exports":{".":"./dist/toggler.mjs"},"browser":{"@byojs/toggler":"./dist/toggler.mjs"},"scripts":{"build:all":"node scripts/build-all.js","build:gh-pages":"npm run build:all && node scripts/build-gh-pages.js","build":"npm run build:all","test:start":"npx http-server test/ -p 8080","test":"npm run test:start","postinstall":"node scripts/postinstall.js","prepublishOnly":"npm run build:all"},"dependencies":{"@byojs/scheduler":"~0.9.4"},"devDependencies":{"micromatch":"~4.0.8","recursive-readdir-sync":"~1.0.6","terser":"~5.39.0"},"repository":{"type":"git","url":"git+https://github.com/byojs/toggler.git"},"keywords":["debounce","throttle","toggle","scheduling","task","async"],"bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"homepage":"https://github.com/byojs/toggler","author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","_id":"@byojs/toggler@0.1.4","gitHead":"f1b943b63692b09cc4d339255d7bada129f36505","_nodeVersion":"21.7.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-jBtY7blxu1QlVC2fRHLLtcotGUzguh3pkgf5qBkd263gtLYDawJ2fMjwbdR+Gx2R4wOp/goNeBKzTEq+gzscjA==","shasum":"8bae17cd954ba6a4d3d6c40c1622e75dad50dedc","tarball":"https://registry.npmjs.org/@byojs/toggler/-/toggler-0.1.4.tgz","fileCount":12,"unpackedSize":25600,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAyJDmx5a07pvGyeMwmzC4meDKhX/KApeqdOAwA2DSgiAiAv0hLlpQGNNJK5xFEHzLq9bDpPK4MdSOKmMT7V3VQpEw=="}]},"_npmUser":{"name":"getify","email":"getify@gmail.com"},"directories":{},"maintainers":[{"name":"getify","email":"getify@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toggler_0.1.4_1739640180070_0.9196680366858827"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-03T20:03:01.805Z","modified":"2025-02-15T17:23:00.544Z","0.0.9":"2024-09-03T20:03:02.197Z","0.1.0":"2024-09-03T22:58:42.003Z","0.1.1":"2024-09-06T16:22:07.804Z","0.1.2":"2024-09-15T00:48:00.939Z","0.1.3":"2025-02-04T22:51:27.421Z","0.1.4":"2025-02-15T17:23:00.327Z"},"bugs":{"url":"https://github.com/byojs/toggler/issues","email":"getify@gmail.com"},"author":{"name":"Kyle Simpson","email":"getify@gmail.com"},"license":"MIT","homepage":"https://github.com/byojs/toggler","keywords":["debounce","throttle","toggle","scheduling","task","async"],"repository":{"type":"git","url":"git+https://github.com/byojs/toggler.git"},"description":"Throttled toggler","maintainers":[{"name":"getify","email":"getify@gmail.com"}],"readme":"# Toggler\n\n[![npm Module](https://badge.fury.io/js/@byojs%2Ftoggler.svg)](https://www.npmjs.org/package/@byojs/toggler)\n[![License](https://img.shields.io/badge/license-MIT-a1356a)](LICENSE.txt)\n\n**Toggler** is a tool to asynchronously toggle between two operations, using [throttled/debounced task scheduling](https://github.com/byojs/scheduler?tab=readme-ov-file#overview).\n\nFor example, managing the showing and hiding of a modal (UI blocking) spinner:\n\n```js\nvar toggle = Toggler(\n    /*taskOneDelay=*/250,\n    /*taskTwoDelay=*/100\n);\n\n// (throttled) toggle on the spinner\ntoggle(showSpinner,hideSpinner);\n\n// later, (throttled) toggle off the spinner\ntoggle(showSpinner,hideSpinner);\n```\n\n**Note:** This example illustrates asynchronously toggling between showing a spinner and hiding it, with throttling/debouncing and cancellation all managed internally.\n\n----\n\n[Library Tests (Demo)](https://byojs.dev/toggler/)\n\n----\n\n## Overview\n\nThe main purpose of **Toggler** is to manage [scheduling (throttling/debouncing)](https://github.com/byojs/scheduler?tab=readme-ov-file#overview) when asynchronously toggling between two tasks.\n\n**Toggler** allows you to specify a *delay* for each of two tasks. It uses this delay to schedule the *next* task -- i.e., it will run *task two* if *task one* most recently ran, or vice versa. Further, if the toggle is re-invoked *during* the scheduling delay for a task, that scheduled task is canceled (state is unchanged).\n\n### Example: Spinner\n\nTo illustrate, let's revisit the spinner example from above:\n\n```js\nvar toggle = Toggler(\n    /*taskOneDelay=*/250,\n    /*taskTwoDelay=*/100\n);\n\n// (throttled) toggle on the spinner\ntoggle(showSpinner,hideSpinner);\n\n// later, (throttled) toggle off the spinner\ntoggle(showSpinner,hideSpinner);\n```\n\nHere, the first `toggle()` call schedules the `showSpinner()` task to run in `250`ms; if `toggle()` is called again before that has delay has transpired, the scheduled call to `showSpinner()` is canceled (and the spinner stays hidden).\n\nLikewise, if the spinner is visible and `toggle()` is called, `hideSpinner()` is delayed by `100`ms; if `toggle()` is called again before that delay has transpired, the scheduled call to `hideSpinner()` is canceled (and the spinner stays visible).\n\n### Toggling use-cases\n\nThe spinner example above is a common use-case for something like **Toggler**. But any UI control that can be toggled between two states is a potential candidate.\n\nFor example, you might use **Toggler** to asynchronously manage showing/hiding of hover/long-press tooltips, to avoid UX messy \"quick flickering\" of tooltips as a user moves their cursor or finger-touch around an interface. A brief delay on both show and hide will generally be friendlier for UX, requiring the user to pause over an element to express more obvious intent, etc. Similar goes for expanding menus/drop-downs.\n\nAnother reason to use **Toggler** would be to manage UI operations that involve animation (e.g., a sliding-in and sliding-out side drawer), since it can be very UX jarring for an animation to be interrupted when only partially complete. **Toggler** could for example ensure that once a *show* animation starts, it has a chance to gracefully finish before the element is hidden (either by animation or immediately).\n\nEven more affirmative user events like clicks/taps -- e.g., opening a popup with a calendar or color picker -- can benefit UX with asynchronous toggling, because clicks/taps sometimes happen accidentally while users scroll around UI content.\n\n#### Lag?\n\nAs touch interfaces became popular a decade or so ago, many mobile browsers introduced a ~300ms delay before firing *click* events on UI elements, because it was felt for UX reasons that distinguishing between a *tap* and a *touch-and-drag* (or other sophisticated gestures, like *double-tap*, *pinch-to-zoom*, etc) was important.\n\nUnfortunately, for UIs (like games) where the *tap* is the main or only gesture, this across-the-board delay created a laggy feeling. Developers used multiple workarounds to avoid this delay, including [CSS `touch-action: manipulation`](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#manipulation) and JS libraries like [FastClick](https://github.com/ftlabs/fastclick) (now deprecated).\n\nLuckily, modern browsers/devices are not necessarily applying these delays quite so universally, and there are more ways to handle these various cases and trade-offs.\n\n**Toggler** is intended to be *another tool* in that effort. You can selectively re-introduce a brief delay (even shorter than 300ms) for a specific part of a UI. *And*, you can delay both the *in* and the *out* of a toggleable state -- something the other CSS/JS solutions just mentioned don't handle.\n\n## Deployment / Import\n\n```cmd\nnpm install @byojs/toggler\n```\n\nThe [**@byojs/toggler** npm package](https://npmjs.com/package/@byojs/toggler) includes a `dist/` directory with all files you need to deploy **Toggler** (and its dependencies) into your application/project.\n\n**Note:** If you obtain this library via git instead of npm, you'll need to [build `dist/` manually](#re-building-dist) before deployment.\n\n### Using a bundler\n\nIf you are using a bundler (Astro, Vite, Webpack, etc) for your web application, you should not need to manually copy any files from `dist/`.\n\nJust `import` like so:\n\n```js\nimport Toggler from \"@byojs/toggler\";\n```\n\nThe bundler tool should pick up and find whatever files (and dependencies) are needed.\n\n### Without using a bundler\n\nIf you are not using a bundler (Astro, Vite, Webpack, etc) for your web application, and just deploying the contents of `dist/` as-is without changes (e.g., to `/path/to/js-assets/toggler/`), you'll need an [Import Map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) in your app's HTML:\n\n```html\n<script type=\"importmap\">\n{\n    \"imports\": {\n        \"toggler\": \"/path/to/js-assets/toggler/toggler.mjs\"\n    }\n}\n</script>\n```\n\nNow, you'll be able to `import` the library in your app in a friendly/readable way:\n\n```js\nimport Toggler from \"toggler\";\n```\n\n**Note:** If you omit the above *toggler* import-map entry, you can still `import` **Toggler** by specifying the proper full path to the `toggler.mjs` file.\n\n## Toggler API\n\nThe API provided by **Toggler** is a single function -- the default export of the module.\n\nThis function receives two integer arguments, to initialize a toggler instance -- represented by another function as its return value -- to [configure dual **byojs/Scheduler** instances](https://github.com/byojs/scheduler?tab=readme-ov-file#scheduler-api). Internally, these two scheduler instances are wired to each other to asynchronously toggle a task between two states, by alternating calls of two functions.\n\n```js\nimport Toggler from \"..\";\n\nvar toggle = Toggler(\n    /*taskOneDelay=*/250,\n    /*taskTwoDelay=*/100\n);\n```\n\n### Toggling Tasks\n\nTo toggle between two tasks (function calls), pass them into the *toggler* instance (`toggle()` from above):\n\n```js\n// (throttled) toggle on the spinner\ntoggle(showSpinner,hideSpinner);\n\n// later, (throttled) toggle off the spinner\ntoggle(showSpinner,hideSpinner);\n```\n\nIf the second `toggle()` call happens before the first interval has transpired (*taskOneDelay* configured above as `250`ms), the first task (`showSpinner()`) will be canceled. However, if the second `toggle()` call doesn't happen before the first delay interval has transpired, the first task (`showSpinner()`) will complete successfully.\n\nEither way, the second task (`hideSpinner()`) will then be scheduled (*taskTwoDelay* configured above as `100`ms).\n\nThe toggling continues back-and-forth between the two tasks, with interval timer and cancelation, indefinitely, as long as the *toggler* instance (again, `toggle()` above) is always called with the same two functions.\n\nYou *can* share the same *toggler* instance can for toggling multiple pairs of tasks/functions, assuming the same timing settings should apply for each pair. However, **do not have the same function instance** participating in two or more pairs of toggling, as this will cause unexpected behavior.\n\n**Warning:** The internal tracking of toggling task functions is based on function reference identity. If you pass an inline function expression (such as an `=>` arrow), the function reference will be different each time, and will be treated as entirely separate functions -- thereby breaking the toggle tracking. Make sure to use the same stable function references pair for all toggling.\n\n## Re-building `dist/*`\n\nIf you need to rebuild the `dist/*` files for any reason, run:\n\n```cmd\n# only needed one time\nnpm install\n\nnpm run build:all\n```\n\n## Tests\n\nThis library only works in a browser, so its test suite must also be run in a browser.\n\nVisit [`https://byojs.dev/toggler/`](https://byojs.dev/toggler/) and click the \"run tests\" button.\n\n### Run Locally\n\nTo instead run the tests locally, first make sure you've [already run the build](#re-building-dist), then:\n\n```cmd\nnpm test\n```\n\nThis will start a static file webserver (no server logic), serving the interactive test page from `http://localhost:8080/`; visit this page in your browser and click the \"run tests\" button.\n\nBy default, the `test/test.js` file imports the code from the `src/*` directly. However, to test against the `dist/*` files (as included in the npm package), you can modify `test/test.js`, updating the `/src` in its `import` statements to `/dist` (see the import-map in `test/index.html` for more details).\n\n## License\n\n[![License](https://img.shields.io/badge/license-MIT-a1356a)](LICENSE.txt)\n\nAll code and documentation are (c) 2024 Kyle Simpson and released under the [MIT License](http://getify.mit-license.org/). A copy of the MIT License [is also included](LICENSE.txt).\n","readmeFilename":"README.md"}