From 6d1c87803dc148948cb9a68a0691d6f92b9c4492 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Wed, 24 Jan 2024 19:43:58 -0800 Subject: [PATCH] Update install details, replace old rawgit links with raw.githack links --- README.md | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 650e740..f24218a 100644 --- a/README.md +++ b/README.md @@ -26,25 +26,17 @@ compiler). ## Install +### Local Install + Install using NPM: ```sh npm install @lume/kiwi ``` -then import it into your project: - -```js -import * as kiwi from '@lume/kiwi' - -console.log(kiwi) - -// ...use kiwi... -``` - If you have a plain web app with no build, or a non-browser JS runtime that also supports import maps like Deno, you'll need to add `@lume/kiwi` to your -`importmap` script so that the browser knows where to import kiwi from. F.e. +`importmap` script so that the browser or JS runtime knows where to import kiwi from. F.e. something like this: ```html @@ -57,8 +49,32 @@ something like this: ``` +### CDN Install + +Note, if using importmaps and native ES Modules in a browser, or in a JS runtime like Deno, you can get Kiwi directly from the UNPKG CDN without installing it locally (just as the [live CodePen demo](#demo) does): + +```html + +``` + ## Usage +After installing, import kiwi into your project: + +```js +import * as kiwi from '@lume/kiwi' + +console.log(kiwi) + +// ...use kiwi... +``` + The following example creates a solver which automatically calculates a width based on some constraints: ```js @@ -99,7 +115,7 @@ setTimeout(() => { ## Benchmarks -To run the benchmark in the browser, [just visit this page](https://rawgit.com/IjzerenHein/kiwi/master/bench/index.html). +To run the benchmark in the browser, [just visit this page](https://raw.githack.com/lume/kiwi/main/bench/index.html). To run the benchmark locally using nodejs, _clone or download this repository_ and execute the following steps: @@ -126,7 +142,7 @@ Fastest is kiwi (± 2.29x faster) ## Tests -To run the tests in the browser, [just visit this page](https://rawgit.com/IjzerenHein/kiwi/master/test/index.html). +To run the tests in the browser, [just visit this page](https://raw.githack.com/lume/kiwi/main/test/index.html). To run the tests locally using nodejs, _clone or download this repository_ and execute the following steps: @@ -150,12 +166,12 @@ open a pull request! [![License](https://img.shields.io/badge/license-BDS%203--clause-brightgreen)]() -