From 5ff9bc4efa2dbe19d49be50bb09075cc1c7bfebe Mon Sep 17 00:00:00 2001 From: John Haugeland Date: Fri, 23 Sep 2016 16:45:56 -0700 Subject: [PATCH] Adding console example, showing a result I added a small example of usage in the `node` console, which shows one simple way to call an easing function, and what the expected result should look like. This makes it easier to understand what the library does, if you don't already know what easings are, and whether this is the right easing library for you, if you do know what they are and are trying to evaluate the API. --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 2cff48d..b22d2c4 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,31 @@ var quadIn = require('eases/quad-in') Each easing has its own file which can be required individually. The entry point also exports all eases with camelCase, so `require('eases/expo-in-out')` becomes `require('eases').expoInOut`. +```javascript +$ node +> const decimals = new Array(11).fill(true).map( (_,i) => i/10); +undefined + +> decimals; +[ 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 ] + +> const quadIn = require('eases/quad-in'); +undefined + +> decimals.map(quadIn); +[ 0, + 0.010000000000000002, + 0.04000000000000001, + 0.09, + 0.16000000000000003, + 0.25, + 0.36, + 0.48999999999999994, + 0.6400000000000001, + 0.81, + 1 ] +``` + Full list of eases: ```js