Installation

NPM

There are a number of Curi packages, all of which can be installed using NPM. The only one that every application requires is @curi/router, which provides the core routing/navigation functionality.

Curi also requires that you create your own history object. There are three packages to choose from: @hickory/browser, @hickory/hash, and @hickory/in-memory. Which package you need depends on the application, but the browser package is best for most websites.

npm install @hickory/browser @curi/router

Unpkg

These packages can also be loaded from Unpkg.

<script
  src="https://unpkg.com/@hickory/browser/dist/hickory-browser.min.js"
></script>
<script
  src="https://unpkg.com/@curi/router/dist/curi-router.min.js"
></script>

Promises

Curi uses Promises, so you may need to include a polyfill to add Promise support for older browsers (including IE 11).

If you need a general ES2015 polyfill, you can check out the one provided by Babel's babel-polyfill package. If you only need a Promise polyfill, es6-promise package or polyfill.io should do the trick.

<script
  src="https://cdn.polyfill.io/v2/polyfill.js?features=Promise"
></script>