You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+15-8
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,10 @@ Installation
34
34
35
35
Note: You can use [bower](http://bower.io/) or [npm](https://www.npmjs.com/) to add this library as a dependency to your project (repository name: `imgcache.js`).
36
36
37
-
To start to use this library, import `js/imgcache.js` within your html file:
37
+
To start to use this library, import `lib/imgcache.js` within your html file:
38
38
39
39
```html
40
-
<scriptsrc="js/imgcache.js"></script>
40
+
<scriptsrc="lib/imgcache.js"></script>
41
41
```
42
42
43
43
Using with PhoneGap/Cordova: see [CORDOVA.md](CORDOVA.md).
@@ -203,19 +203,26 @@ Overridable methods
203
203
204
204
Promises
205
205
--------
206
-
Include also [qimgcache.js](js/qimgcache.js)in your html files to be able to use its [Q Promises](https://github.com/kriskowal/q) interface if you don't like callbacks and prefer to use the simpler then/fail/progress methods.
206
+
Include the [imgcache-promise.js](lib/imgcache-promise.js)wrapper into your project to be able to use ES6-compatible Promises (using [Bluebird](http://bluebirdjs.com/) for instance) if you don't like callbacks and prefer to use the simpler then/catch methods.
207
207
208
208
This wrapper also makes sure the init method is always called first, so you SHOULDN'T call this method yourself when using this wrapper.
209
209
210
210
Check out the [sample code](examples/promises.html).
211
211
212
-
Unit tests
212
+
Unit tests and code samples
213
213
----------
214
-
Open `index.html` and click 'Start unit tests' to launch unit tests.
214
+
Run a local server:
215
215
216
-
Code samples
217
-
------------
218
-
Open `index.html` to check out several examples.
216
+
```shell
217
+
npm install
218
+
npm start
219
+
```
220
+
221
+
Then open the given url in your Chrome browser (`index.html`) and click 'Start unit tests' to launch unit tests.
222
+
223
+
You will be able to find several code samples.
224
+
225
+
To lint the main javascript code, you can run `npm test` to start [eslint](http://eslint.org/)
0 commit comments