├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── example-complete ├── package-lock.json ├── package.json ├── public │ ├── example.appcache │ ├── index.html │ ├── script.js │ └── styles.css └── src │ ├── router.js │ ├── server.js │ └── start.js ├── example ├── package-lock.json ├── package.json ├── public │ ├── index.html │ ├── script.js │ └── styles.css └── src │ ├── router.js │ ├── server.js │ └── start.js ├── package-lock.json ├── package.json └── test ├── example.spec.js └── exampleComplete.spec.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '6' 4 | script: 5 | npm run coverage 6 | 7 | before_install: 8 | - pip install --user codecov 9 | 10 | after_success: 11 | - codecov --file coverage/lcov.info --disable search 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Learn offline first 2 | 3 | Learn how to build web apps that can be used offline! 4 | 5 | [![codecov](https://codecov.io/gh/dwyl/learn-offline-first/branch/master/graph/badge.svg)](https://codecov.io/gh/dwyl/learn-offline-first) 6 | [![Build Status](https://travis-ci.org/dwyl/learn-offline-first.svg?branch=master)](https://travis-ci.org/dwyl/learn-offline-first) 7 | 8 | 9 | ## Why? 10 | 11 | The majority of people using the web are using mobile devices, 12 | and mobile devices mean that an internet connection 13 | will not always be available. 14 | By making web applications that are offline first we can make it 15 | so that our users can use our app without worrying about accidentally 16 | refreshing the page and getting a 'Sorry you're offline' page from your browser. 17 | 18 | Not only that, but it means that the second time someone visits your webpage, 19 | it will load instantly! (because the files are cached locally). 20 | 21 | This means that even people who aren't using your app offline benefit 22 | from its offline first functionality. It means that people with poor 23 | or intermittent internet connections (the majority of people in the world) 24 | will have a more consistent, and better experience using our applications. 25 | 26 | ## What? 27 | 28 | Offline first web applications are websites which 29 | make offline functionality a priority. 30 | But what does that actually mean? It means we use the browser's ability 31 | to store data on the local device to make your web application work offline. 32 | 33 | ## How? 34 | 35 | There are two widely used methods for offline first apps, 36 | **Service Workers** and **Application Cache**. 37 | 38 | ## Application Cache 39 | 40 | **Advantages**: 41 | + Supports all modern browsers including Safari (desktop and iOS) 42 | + Easy to set up 43 | + Can be combined with service workers 44 | 45 | **Disadvantages**: 46 | + As far as we know there's no way to make operations wait for a connection 47 | to be established - even when the website isn't open in browser - 48 | before actioning them. With service workers this is achieved 49 | using `background sync`. 50 | 51 | ## Service workers 52 | 53 | **Advantages** 54 | + Lots of recent and good resources of how to use them 55 | + Can do background-sync and push notifications 56 | (_as they continue to run when the website is closed_) 57 | 58 | **Disadvantages** 59 | + Only currently supported by Chrome and Firefox. 60 | + Uses promises, so not very beginner friendly 61 | 62 | Since `Application Cache` is supported on all modern browsers (IE8 onwards), 63 | we're going to use it for our example. So, let's get stuck in! 64 | 65 | ## Building your first offline first app 66 | 67 | ### Setup 68 | 69 | #### 1. Clone this repository and change directory into it 70 | ``` 71 | git clone git@github.com:dwyl/learn-offline-first.git 72 | cd learn-offline-first 73 | ``` 74 | 75 | #### 2. Start the server 76 | 77 | In the example files we're using a simple Node.js Hapi server 78 | to serve the app files. 79 | For more information on setting up Node and Hapi.js check 80 | see: [github.com/dwyl/**learn-hapi**](https://github.com/dwyl/learn-hapi) 81 | 82 | `cd` into the example-basic directory: 83 | ``` 84 | cd example 85 | ``` 86 | 87 | Install the dependencies: 88 | ``` 89 | npm i 90 | ``` 91 | 92 | Start the server with nodemon: 93 | ``` 94 | npm run dev 95 | ``` 96 | 97 | Visit `http://localhost:4000/` in your browser to check out the counter! 98 | 99 | #### What about the tests?!? :white_check_mark: :100: 100 | 101 | :sparkles: If you want to run the tests then 102 | ``` 103 | npm test 104 | ``` 105 | :sparkles: and if you'd like to see our test coverage run 106 | ``` 107 | npm run coverage 108 | ``` 109 | #### 3. Open the public folder in your favourite text editor 110 | 111 | ## Adding offline support 112 | 113 | ### Appcache manifest 114 | 115 | To make a site available offline (_even on iOS!_) you have to define 116 | which assets are cached in an `.appcache` file, then link the site to 117 | the `appcache` by including a `manifest` attribute in the application html. 118 | 119 | Create a file in the public directory called `example.appcache` 120 | and add CACHE MANIFEST to the first line. This lets the browser know what 121 | to expect from the manifest file. Next, you need to add all the files 122 | you want to be cached under a **CACHE** heading: 123 | 124 | 125 | ``` 126 | CACHE MANIFEST 127 | 128 | CACHE: 129 | index.html 130 | styles.css 131 | script.js 132 | ``` 133 | 134 | Another important step when writing `appcache` manifests is to add 135 | a **NETWORK** heading. Files listed under network can be 136 | fetched over the network, so even if they're not in the cache they 137 | can still be served to the client. A safe *catch-all* option is to 138 | add a wildcard `*` here. That way, if you add new files to the application, 139 | the manifest won't get confused and freak out, 140 | it'll just fetch the new content over the network. 141 | 142 | ``` 143 | NETWORK: 144 | * 145 | ``` 146 | 147 | ### Linking the manifest to your application 148 | 149 | Simply add the manifest attribute to your `html` tag: 150 | 151 | ```html 152 | 153 | ``` 154 | 155 | ### Make the app refresh when there's new content 156 | 157 | Really that's all that's required for an offline first static site. 158 | 159 | But there's a big problem! If the site is updated between user visits, 160 | they won't get the new version until they refresh the page twice. 161 | **Far** from ideal. 162 | 163 | To fix this, first you need to update your .appcache manifest file 164 | to prompt the browser to recache the files. Any change will force 165 | a re-cache even if it's just a comment, so one easy option is to 166 | include a version number as a comment in the manifest that can be 167 | updated each time the site is published. 168 | 169 | **Comments in .appcache files start with a `#`** 170 | 171 | The next step is to add some javascript to your app to force it to 172 | check for an update to the manifest, and if that update exists, 173 | refresh the page: 174 | 175 | ```js 176 | var appCache = window.applicationCache; 177 | // Only run if the appCache isn't busy 178 | if (appCache.status === appCache.IDLE) { 179 | // Force the app to check for an update 180 | appCache.update(); 181 | } 182 | // Check for a cache update 183 | if (appCache.status === appCache.UPDATEREADY) { 184 | // Set the page cache to the new content on page load 185 | appCache.swapCache(); 186 | } 187 | // Listen for updates 188 | appCache.addEventListener('updateready', function(e) { 189 | // Reload the page when there's an update 190 | window.location.reload(); 191 | }); 192 | ``` 193 | ### Persist data between visits 194 | 195 | Although the code we've seen so far works **really well** 196 | for static sites, it's a lot less useful for apps with dynamic saved data. 197 | For this we'll need to access the browser's internal storage. 198 | 199 | As we're using Application Cache (great browser support :tv:) 200 | we'll go for Local Storage (great browser support :computer:). 201 | [See below for Storing Options](#options-for-storing-application-state-locally) 202 | for more information on the other available options 203 | for storing data in the browser. 204 | 205 | Local storage has a very simple interface encapsulated 206 | in the following snippet of code: 207 | 208 | ```js 209 | // Sets a key (greeting) and value (hello) to the browser's local storage 210 | localStorage.setItem("greeting", "Hello"); 211 | // Retrieves the value of the given key 212 | var greeting = localStorage.getItem("greeting"); 213 | console.log(greeting); // Hello 214 | ``` 215 | 216 | To have the count persist between visits, it needs to be saved to localStorage. 217 | Every time there's an `update` to the count it has to be saved. 218 | Adding this functionality just requires a single line of javascript 219 | in the `update` function in `script.js`: 220 | 221 | ```js 222 | function update(newModel, element) { 223 | model = newModel; 224 | element.innerText = model; 225 | window.localStorage.setItem('model', model); 226 | } 227 | ``` 228 | 229 | Finally, we need the app to check for previously saved counts 230 | when it starts (after the model is first set): 231 | 232 | ```js 233 | var model = 0; 234 | 235 | var storedModel = window.localStorage.getItem('model'); 236 | 237 | if (storedModel) { 238 | model = Number(storedModel); 239 | update(model, count); 240 | } 241 | ``` 242 | 243 | ### Checking if the client is online 244 | Another aspect of offline first apps is checking whether the user 245 | is online or offline and adjusting your app's behaviour accordingly. 246 | 247 | For example, if you know the user is offline, you can make sure 248 | not to send off any information to your database, and instead 249 | just use your local storage, then, when the user comes back online, 250 | send all the info off! 251 | 252 | In your `index.html` file add 253 | 254 | ```html 255 |

256 | ``` 257 | after the last button. We're going to use this to tell the user 258 | whether they are offline or online! 259 | 260 | `navigator.onLine` is a boolean value 261 | (available in more or less all browsers from IE8 onwards) 262 | which will be `true` if online and `false` if offline. 263 | We can use this to set up the online-status in the DOM for the user. 264 | 265 | So let's get that set up! 266 | 267 | ```js 268 | // get the online status element from the DOM 269 | var onlineStatusDom = document.querySelector('.online-status'); 270 | // Here we update the text in the online status element in the DOM to reflect the online status from navigator.onLine 271 | if (navigator.onLine) { 272 | onlineStatusDom.innerText = 'online'; 273 | } else { 274 | onlineStatusDom.innerText = 'offline'; 275 | } 276 | ``` 277 | 278 | There are also events on the window object (or `document.body` in IE8) 279 | which fire when the user goes offline or comes online, we can use these 280 | to dynamically update the online status shown to the user 281 | when their connection changes, like this: 282 | 283 | ```js 284 | window.addEventListener('offline', function(e) { 285 | onlineStatusDom.innerText = 'offline'; 286 | }); 287 | 288 | window.addEventListener('online', function(e) { 289 | onlineStatusDom.innerText = 'online'; 290 | }); 291 | ``` 292 | 293 | ## Reading 294 | 295 | #### Options for storing application state locally 296 | 297 | In our example we've used `localStorage` as it has awesome :heart_eyes: 298 | browser compatibility and the api is quite straightforward to use. However, 299 | there are more modern solutions to storing application state locally. 300 | Local storage is not always the best solution as it can be _limited_ to **1mb** 301 | of storage on some browsers, it can only store strings 302 | (or, anything that you stringify), it's a basic key value storage system 303 | so you can only _replace_ a key/value pair and not update the value of a key 304 | (inefficient), and it's synchronous, so it blocks the thread 305 | (_everything else in your code has to **wait** 306 | until `localStorage` has finished its work!_) 307 | 308 | There's also IndexedDB, but browser support for this is patchy :( 309 | A good option is using an API which wraps IndexedDB and `localStorage` together, 310 | and where available will use IndexedDB, but in its absence 311 | will use local storage, all with one syntax so you don't have to worry 312 | about which to use. 313 | 314 | Options for these include: 315 | - [localForage](https://github.com/localForage/localForage) 316 | - [ydn-db](https://github.com/yathit/ydn-db) 317 | - [Lawnchair](https://github.com/brianleroux/lawnchair) 318 | - [pouchDB](https://github.com/pouchdb/pouchdb) 319 | 320 | PouchDB and LocalForage both use 321 | [promises](https://developers.google.com/web/fundamentals/getting-started/primers/promises) 322 | which still have patchy browser support, so aren't always the best option, 323 | ydn-db uses quite confusing syntax which is very SQL-like and can be 324 | a bit much when you're getting your head around local storage, and Lawnchair, 325 | though focused on simple JSON storage, and nice and tiny, 326 | the syntax can be a little much when just starting with offline first apps. 327 | 328 | To start with, we'd reccomend using local storage, like we have in our example, 329 | and when you're comfortable with that, have a play with some of the APIs 330 | to see which you feel fits your needs the best. 331 | 332 | #### General offline first 333 | 334 | Useful resources for creating Offline-First web apps: https://github.com/pazguille/offline-first 335 | 336 | #### Application cache 337 | 338 | + Great overview of application cache: http://diveintohtml5.info/offline.html 339 | + Iphone specific application cache guide: https://www.thecssninja.com/css/how-to-create-offline-webapps-on-the-iphone 340 | + Beginner's guide: https://www.html5rocks.com/en/tutorials/appcache/beginner/ 341 | + Nolan Lawsom presentation on offline first: http://nolanlawson.github.io/offline-first-presentation/ 342 | 343 | #### Service workers 344 | 345 | + Introduction to service workers: https://developers.google.com/web/fundamentals/getting-started/primers/service-workers 346 | + Service Worker Precache (module for generating a service worker): https://github.com/GoogleChrome/sw-precache 347 | -------------------------------------------------------------------------------- /example-complete/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "abbrev": { 7 | "version": "1.1.0", 8 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", 9 | "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=" 10 | }, 11 | "accept": { 12 | "version": "2.1.4", 13 | "resolved": "https://registry.npmjs.org/accept/-/accept-2.1.4.tgz", 14 | "integrity": "sha1-iHr1TO7lx/RDBGGXHsQAxh0JrLs=" 15 | }, 16 | "ammo": { 17 | "version": "2.0.4", 18 | "resolved": "https://registry.npmjs.org/ammo/-/ammo-2.0.4.tgz", 19 | "integrity": "sha1-v4CqshFpjqePY+9efxE91dnokX8=" 20 | }, 21 | "ansi-regex": { 22 | "version": "2.1.1", 23 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 24 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 25 | }, 26 | "ansi-styles": { 27 | "version": "2.2.1", 28 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 29 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" 30 | }, 31 | "anymatch": { 32 | "version": "1.3.0", 33 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", 34 | "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=" 35 | }, 36 | "arr-diff": { 37 | "version": "2.0.0", 38 | "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", 39 | "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=" 40 | }, 41 | "arr-flatten": { 42 | "version": "1.0.3", 43 | "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.3.tgz", 44 | "integrity": "sha1-onTthawIhJtr14R8RYB0XcUa37E=" 45 | }, 46 | "array-unique": { 47 | "version": "0.2.1", 48 | "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", 49 | "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" 50 | }, 51 | "arrify": { 52 | "version": "1.0.1", 53 | "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", 54 | "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" 55 | }, 56 | "async-each": { 57 | "version": "1.0.1", 58 | "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", 59 | "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" 60 | }, 61 | "b64": { 62 | "version": "3.0.2", 63 | "resolved": "https://registry.npmjs.org/b64/-/b64-3.0.2.tgz", 64 | "integrity": "sha1-ep1gRmrfe43hFMvfZRpf38yQiU0=" 65 | }, 66 | "balanced-match": { 67 | "version": "1.0.0", 68 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 69 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 70 | }, 71 | "binary-extensions": { 72 | "version": "1.8.0", 73 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", 74 | "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=" 75 | }, 76 | "boom": { 77 | "version": "5.1.0", 78 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.1.0.tgz", 79 | "integrity": "sha1-Awj6jpJM1tQtnDv0iDvcmPDnHfg=" 80 | }, 81 | "brace-expansion": { 82 | "version": "1.1.8", 83 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", 84 | "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=" 85 | }, 86 | "braces": { 87 | "version": "1.8.5", 88 | "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", 89 | "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=" 90 | }, 91 | "call": { 92 | "version": "4.0.2", 93 | "resolved": "https://registry.npmjs.org/call/-/call-4.0.2.tgz", 94 | "integrity": "sha1-33b19R7o3Ui4VqyEAPfmnm1zmcQ=" 95 | }, 96 | "catbox": { 97 | "version": "7.1.4", 98 | "resolved": "https://registry.npmjs.org/catbox/-/catbox-7.1.4.tgz", 99 | "integrity": "sha1-ipUO0YtkuoCIwa4TLoXFhHnStsw=" 100 | }, 101 | "catbox-memory": { 102 | "version": "2.0.4", 103 | "resolved": "https://registry.npmjs.org/catbox-memory/-/catbox-memory-2.0.4.tgz", 104 | "integrity": "sha1-Qz4lWQLK9UIz0ShkKcj03xToItU=" 105 | }, 106 | "chalk": { 107 | "version": "1.1.3", 108 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 109 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=" 110 | }, 111 | "chokidar": { 112 | "version": "1.7.0", 113 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", 114 | "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=" 115 | }, 116 | "concat-map": { 117 | "version": "0.0.1", 118 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 119 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 120 | }, 121 | "configstore": { 122 | "version": "1.4.0", 123 | "resolved": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", 124 | "integrity": "sha1-w1eB0FAdJowlxUuLF/YkDopPsCE=" 125 | }, 126 | "content": { 127 | "version": "3.0.4", 128 | "resolved": "https://registry.npmjs.org/content/-/content-3.0.4.tgz", 129 | "integrity": "sha1-yj3eBEgPElGbcVJuxEvUiN37P+8=" 130 | }, 131 | "core-util-is": { 132 | "version": "1.0.2", 133 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 134 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 135 | }, 136 | "cryptiles": { 137 | "version": "3.1.2", 138 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", 139 | "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=" 140 | }, 141 | "debug": { 142 | "version": "2.6.8", 143 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", 144 | "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=" 145 | }, 146 | "deep-extend": { 147 | "version": "0.4.2", 148 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", 149 | "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" 150 | }, 151 | "duplexer": { 152 | "version": "0.1.1", 153 | "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", 154 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" 155 | }, 156 | "duplexify": { 157 | "version": "3.5.0", 158 | "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", 159 | "integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=" 160 | }, 161 | "end-of-stream": { 162 | "version": "1.0.0", 163 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", 164 | "integrity": "sha1-1FlucCc0qT5A6a+GQxnqvZn/Lw4=" 165 | }, 166 | "es6-promise": { 167 | "version": "3.3.1", 168 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", 169 | "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=" 170 | }, 171 | "escape-string-regexp": { 172 | "version": "1.0.5", 173 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 174 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 175 | }, 176 | "event-stream": { 177 | "version": "3.3.4", 178 | "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", 179 | "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=" 180 | }, 181 | "expand-brackets": { 182 | "version": "0.1.5", 183 | "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", 184 | "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=" 185 | }, 186 | "expand-range": { 187 | "version": "1.8.2", 188 | "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", 189 | "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=" 190 | }, 191 | "extglob": { 192 | "version": "0.3.2", 193 | "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", 194 | "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=" 195 | }, 196 | "filename-regex": { 197 | "version": "2.0.1", 198 | "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", 199 | "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" 200 | }, 201 | "fill-range": { 202 | "version": "2.2.3", 203 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", 204 | "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=" 205 | }, 206 | "for-in": { 207 | "version": "1.0.2", 208 | "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", 209 | "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" 210 | }, 211 | "for-own": { 212 | "version": "0.1.5", 213 | "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", 214 | "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=" 215 | }, 216 | "from": { 217 | "version": "0.1.7", 218 | "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", 219 | "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" 220 | }, 221 | "fsevents": { 222 | "version": "1.1.2", 223 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", 224 | "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", 225 | "optional": true, 226 | "dependencies": { 227 | "abbrev": { 228 | "version": "1.1.0", 229 | "bundled": true, 230 | "optional": true 231 | }, 232 | "ajv": { 233 | "version": "4.11.8", 234 | "bundled": true, 235 | "optional": true 236 | }, 237 | "ansi-regex": { 238 | "version": "2.1.1", 239 | "bundled": true 240 | }, 241 | "aproba": { 242 | "version": "1.1.1", 243 | "bundled": true, 244 | "optional": true 245 | }, 246 | "are-we-there-yet": { 247 | "version": "1.1.4", 248 | "bundled": true, 249 | "optional": true 250 | }, 251 | "asn1": { 252 | "version": "0.2.3", 253 | "bundled": true, 254 | "optional": true 255 | }, 256 | "assert-plus": { 257 | "version": "0.2.0", 258 | "bundled": true, 259 | "optional": true 260 | }, 261 | "asynckit": { 262 | "version": "0.4.0", 263 | "bundled": true, 264 | "optional": true 265 | }, 266 | "aws-sign2": { 267 | "version": "0.6.0", 268 | "bundled": true, 269 | "optional": true 270 | }, 271 | "aws4": { 272 | "version": "1.6.0", 273 | "bundled": true, 274 | "optional": true 275 | }, 276 | "balanced-match": { 277 | "version": "0.4.2", 278 | "bundled": true 279 | }, 280 | "bcrypt-pbkdf": { 281 | "version": "1.0.1", 282 | "bundled": true, 283 | "optional": true 284 | }, 285 | "block-stream": { 286 | "version": "0.0.9", 287 | "bundled": true 288 | }, 289 | "boom": { 290 | "version": "2.10.1", 291 | "bundled": true 292 | }, 293 | "brace-expansion": { 294 | "version": "1.1.7", 295 | "bundled": true 296 | }, 297 | "buffer-shims": { 298 | "version": "1.0.0", 299 | "bundled": true 300 | }, 301 | "caseless": { 302 | "version": "0.12.0", 303 | "bundled": true, 304 | "optional": true 305 | }, 306 | "co": { 307 | "version": "4.6.0", 308 | "bundled": true, 309 | "optional": true 310 | }, 311 | "code-point-at": { 312 | "version": "1.1.0", 313 | "bundled": true 314 | }, 315 | "combined-stream": { 316 | "version": "1.0.5", 317 | "bundled": true 318 | }, 319 | "concat-map": { 320 | "version": "0.0.1", 321 | "bundled": true 322 | }, 323 | "console-control-strings": { 324 | "version": "1.1.0", 325 | "bundled": true 326 | }, 327 | "core-util-is": { 328 | "version": "1.0.2", 329 | "bundled": true 330 | }, 331 | "cryptiles": { 332 | "version": "2.0.5", 333 | "bundled": true, 334 | "optional": true 335 | }, 336 | "dashdash": { 337 | "version": "1.14.1", 338 | "bundled": true, 339 | "optional": true, 340 | "dependencies": { 341 | "assert-plus": { 342 | "version": "1.0.0", 343 | "bundled": true, 344 | "optional": true 345 | } 346 | } 347 | }, 348 | "debug": { 349 | "version": "2.6.8", 350 | "bundled": true, 351 | "optional": true 352 | }, 353 | "deep-extend": { 354 | "version": "0.4.2", 355 | "bundled": true, 356 | "optional": true 357 | }, 358 | "delayed-stream": { 359 | "version": "1.0.0", 360 | "bundled": true 361 | }, 362 | "delegates": { 363 | "version": "1.0.0", 364 | "bundled": true, 365 | "optional": true 366 | }, 367 | "ecc-jsbn": { 368 | "version": "0.1.1", 369 | "bundled": true, 370 | "optional": true 371 | }, 372 | "extend": { 373 | "version": "3.0.1", 374 | "bundled": true, 375 | "optional": true 376 | }, 377 | "extsprintf": { 378 | "version": "1.0.2", 379 | "bundled": true 380 | }, 381 | "forever-agent": { 382 | "version": "0.6.1", 383 | "bundled": true, 384 | "optional": true 385 | }, 386 | "form-data": { 387 | "version": "2.1.4", 388 | "bundled": true, 389 | "optional": true 390 | }, 391 | "fs.realpath": { 392 | "version": "1.0.0", 393 | "bundled": true 394 | }, 395 | "fstream": { 396 | "version": "1.0.11", 397 | "bundled": true 398 | }, 399 | "fstream-ignore": { 400 | "version": "1.0.5", 401 | "bundled": true, 402 | "optional": true 403 | }, 404 | "gauge": { 405 | "version": "2.7.4", 406 | "bundled": true, 407 | "optional": true 408 | }, 409 | "getpass": { 410 | "version": "0.1.7", 411 | "bundled": true, 412 | "optional": true, 413 | "dependencies": { 414 | "assert-plus": { 415 | "version": "1.0.0", 416 | "bundled": true, 417 | "optional": true 418 | } 419 | } 420 | }, 421 | "glob": { 422 | "version": "7.1.2", 423 | "bundled": true 424 | }, 425 | "graceful-fs": { 426 | "version": "4.1.11", 427 | "bundled": true 428 | }, 429 | "har-schema": { 430 | "version": "1.0.5", 431 | "bundled": true, 432 | "optional": true 433 | }, 434 | "har-validator": { 435 | "version": "4.2.1", 436 | "bundled": true, 437 | "optional": true 438 | }, 439 | "has-unicode": { 440 | "version": "2.0.1", 441 | "bundled": true, 442 | "optional": true 443 | }, 444 | "hawk": { 445 | "version": "3.1.3", 446 | "bundled": true, 447 | "optional": true 448 | }, 449 | "hoek": { 450 | "version": "2.16.3", 451 | "bundled": true 452 | }, 453 | "http-signature": { 454 | "version": "1.1.1", 455 | "bundled": true, 456 | "optional": true 457 | }, 458 | "inflight": { 459 | "version": "1.0.6", 460 | "bundled": true 461 | }, 462 | "inherits": { 463 | "version": "2.0.3", 464 | "bundled": true 465 | }, 466 | "ini": { 467 | "version": "1.3.4", 468 | "bundled": true, 469 | "optional": true 470 | }, 471 | "is-fullwidth-code-point": { 472 | "version": "1.0.0", 473 | "bundled": true 474 | }, 475 | "is-typedarray": { 476 | "version": "1.0.0", 477 | "bundled": true, 478 | "optional": true 479 | }, 480 | "isarray": { 481 | "version": "1.0.0", 482 | "bundled": true 483 | }, 484 | "isstream": { 485 | "version": "0.1.2", 486 | "bundled": true, 487 | "optional": true 488 | }, 489 | "jodid25519": { 490 | "version": "1.0.2", 491 | "bundled": true, 492 | "optional": true 493 | }, 494 | "jsbn": { 495 | "version": "0.1.1", 496 | "bundled": true, 497 | "optional": true 498 | }, 499 | "json-schema": { 500 | "version": "0.2.3", 501 | "bundled": true, 502 | "optional": true 503 | }, 504 | "json-stable-stringify": { 505 | "version": "1.0.1", 506 | "bundled": true, 507 | "optional": true 508 | }, 509 | "json-stringify-safe": { 510 | "version": "5.0.1", 511 | "bundled": true, 512 | "optional": true 513 | }, 514 | "jsonify": { 515 | "version": "0.0.0", 516 | "bundled": true, 517 | "optional": true 518 | }, 519 | "jsprim": { 520 | "version": "1.4.0", 521 | "bundled": true, 522 | "optional": true, 523 | "dependencies": { 524 | "assert-plus": { 525 | "version": "1.0.0", 526 | "bundled": true, 527 | "optional": true 528 | } 529 | } 530 | }, 531 | "mime-db": { 532 | "version": "1.27.0", 533 | "bundled": true 534 | }, 535 | "mime-types": { 536 | "version": "2.1.15", 537 | "bundled": true 538 | }, 539 | "minimatch": { 540 | "version": "3.0.4", 541 | "bundled": true 542 | }, 543 | "minimist": { 544 | "version": "0.0.8", 545 | "bundled": true 546 | }, 547 | "mkdirp": { 548 | "version": "0.5.1", 549 | "bundled": true 550 | }, 551 | "ms": { 552 | "version": "2.0.0", 553 | "bundled": true, 554 | "optional": true 555 | }, 556 | "node-pre-gyp": { 557 | "version": "0.6.36", 558 | "bundled": true, 559 | "optional": true 560 | }, 561 | "nopt": { 562 | "version": "4.0.1", 563 | "bundled": true, 564 | "optional": true 565 | }, 566 | "npmlog": { 567 | "version": "4.1.0", 568 | "bundled": true, 569 | "optional": true 570 | }, 571 | "number-is-nan": { 572 | "version": "1.0.1", 573 | "bundled": true 574 | }, 575 | "oauth-sign": { 576 | "version": "0.8.2", 577 | "bundled": true, 578 | "optional": true 579 | }, 580 | "object-assign": { 581 | "version": "4.1.1", 582 | "bundled": true, 583 | "optional": true 584 | }, 585 | "once": { 586 | "version": "1.4.0", 587 | "bundled": true 588 | }, 589 | "os-homedir": { 590 | "version": "1.0.2", 591 | "bundled": true, 592 | "optional": true 593 | }, 594 | "os-tmpdir": { 595 | "version": "1.0.2", 596 | "bundled": true, 597 | "optional": true 598 | }, 599 | "osenv": { 600 | "version": "0.1.4", 601 | "bundled": true, 602 | "optional": true 603 | }, 604 | "path-is-absolute": { 605 | "version": "1.0.1", 606 | "bundled": true 607 | }, 608 | "performance-now": { 609 | "version": "0.2.0", 610 | "bundled": true, 611 | "optional": true 612 | }, 613 | "process-nextick-args": { 614 | "version": "1.0.7", 615 | "bundled": true 616 | }, 617 | "punycode": { 618 | "version": "1.4.1", 619 | "bundled": true, 620 | "optional": true 621 | }, 622 | "qs": { 623 | "version": "6.4.0", 624 | "bundled": true, 625 | "optional": true 626 | }, 627 | "rc": { 628 | "version": "1.2.1", 629 | "bundled": true, 630 | "optional": true, 631 | "dependencies": { 632 | "minimist": { 633 | "version": "1.2.0", 634 | "bundled": true, 635 | "optional": true 636 | } 637 | } 638 | }, 639 | "readable-stream": { 640 | "version": "2.2.9", 641 | "bundled": true 642 | }, 643 | "request": { 644 | "version": "2.81.0", 645 | "bundled": true, 646 | "optional": true 647 | }, 648 | "rimraf": { 649 | "version": "2.6.1", 650 | "bundled": true 651 | }, 652 | "safe-buffer": { 653 | "version": "5.0.1", 654 | "bundled": true 655 | }, 656 | "semver": { 657 | "version": "5.3.0", 658 | "bundled": true, 659 | "optional": true 660 | }, 661 | "set-blocking": { 662 | "version": "2.0.0", 663 | "bundled": true, 664 | "optional": true 665 | }, 666 | "signal-exit": { 667 | "version": "3.0.2", 668 | "bundled": true, 669 | "optional": true 670 | }, 671 | "sntp": { 672 | "version": "1.0.9", 673 | "bundled": true, 674 | "optional": true 675 | }, 676 | "sshpk": { 677 | "version": "1.13.0", 678 | "bundled": true, 679 | "optional": true, 680 | "dependencies": { 681 | "assert-plus": { 682 | "version": "1.0.0", 683 | "bundled": true, 684 | "optional": true 685 | } 686 | } 687 | }, 688 | "string_decoder": { 689 | "version": "1.0.1", 690 | "bundled": true 691 | }, 692 | "string-width": { 693 | "version": "1.0.2", 694 | "bundled": true 695 | }, 696 | "stringstream": { 697 | "version": "0.0.5", 698 | "bundled": true, 699 | "optional": true 700 | }, 701 | "strip-ansi": { 702 | "version": "3.0.1", 703 | "bundled": true 704 | }, 705 | "strip-json-comments": { 706 | "version": "2.0.1", 707 | "bundled": true, 708 | "optional": true 709 | }, 710 | "tar": { 711 | "version": "2.2.1", 712 | "bundled": true 713 | }, 714 | "tar-pack": { 715 | "version": "3.4.0", 716 | "bundled": true, 717 | "optional": true 718 | }, 719 | "tough-cookie": { 720 | "version": "2.3.2", 721 | "bundled": true, 722 | "optional": true 723 | }, 724 | "tunnel-agent": { 725 | "version": "0.6.0", 726 | "bundled": true, 727 | "optional": true 728 | }, 729 | "tweetnacl": { 730 | "version": "0.14.5", 731 | "bundled": true, 732 | "optional": true 733 | }, 734 | "uid-number": { 735 | "version": "0.0.6", 736 | "bundled": true, 737 | "optional": true 738 | }, 739 | "util-deprecate": { 740 | "version": "1.0.2", 741 | "bundled": true 742 | }, 743 | "uuid": { 744 | "version": "3.0.1", 745 | "bundled": true, 746 | "optional": true 747 | }, 748 | "verror": { 749 | "version": "1.3.6", 750 | "bundled": true, 751 | "optional": true 752 | }, 753 | "wide-align": { 754 | "version": "1.1.2", 755 | "bundled": true, 756 | "optional": true 757 | }, 758 | "wrappy": { 759 | "version": "1.0.2", 760 | "bundled": true 761 | } 762 | } 763 | }, 764 | "glob-base": { 765 | "version": "0.3.0", 766 | "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", 767 | "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=" 768 | }, 769 | "glob-parent": { 770 | "version": "2.0.0", 771 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", 772 | "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=" 773 | }, 774 | "got": { 775 | "version": "3.3.1", 776 | "resolved": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", 777 | "integrity": "sha1-5dDtSvVfw+701WAHdp2YGSvLLso=", 778 | "dependencies": { 779 | "object-assign": { 780 | "version": "3.0.0", 781 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", 782 | "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" 783 | } 784 | } 785 | }, 786 | "graceful-fs": { 787 | "version": "4.1.11", 788 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", 789 | "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" 790 | }, 791 | "hapi": { 792 | "version": "16.4.3", 793 | "resolved": "https://registry.npmjs.org/hapi/-/hapi-16.4.3.tgz", 794 | "integrity": "sha512-1jN2dj3KeNAHWs5/rFCGPjYyyoDqG1orkwJyL1OHjbODnhsCbZ6AQOgroOUyNUCH3KCZ6dU/dimAW83gJiBjsA==" 795 | }, 796 | "has-ansi": { 797 | "version": "2.0.0", 798 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 799 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=" 800 | }, 801 | "heavy": { 802 | "version": "4.0.4", 803 | "resolved": "https://registry.npmjs.org/heavy/-/heavy-4.0.4.tgz", 804 | "integrity": "sha1-NskTNsAMz+hSyqTRUwhjNc0vAOk=" 805 | }, 806 | "hoek": { 807 | "version": "4.1.1", 808 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.1.1.tgz", 809 | "integrity": "sha1-nMVz/7ore0CPtenCoTeWvpTN3Ok=" 810 | }, 811 | "ignore-by-default": { 812 | "version": "1.0.1", 813 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 814 | "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" 815 | }, 816 | "imurmurhash": { 817 | "version": "0.1.4", 818 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 819 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" 820 | }, 821 | "inert": { 822 | "version": "4.2.0", 823 | "resolved": "https://registry.npmjs.org/inert/-/inert-4.2.0.tgz", 824 | "integrity": "sha1-aqXajOGZgutyqr70vdpk/WdQsAU=", 825 | "dependencies": { 826 | "boom": { 827 | "version": "4.3.1", 828 | "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", 829 | "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=" 830 | } 831 | } 832 | }, 833 | "infinity-agent": { 834 | "version": "2.0.3", 835 | "resolved": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", 836 | "integrity": "sha1-ReDi/3qesDCyfWK3SzdEt6esQhY=" 837 | }, 838 | "inherits": { 839 | "version": "2.0.3", 840 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 841 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 842 | }, 843 | "ini": { 844 | "version": "1.3.4", 845 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", 846 | "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" 847 | }, 848 | "iron": { 849 | "version": "4.0.5", 850 | "resolved": "https://registry.npmjs.org/iron/-/iron-4.0.5.tgz", 851 | "integrity": "sha1-TwQszri5c480a1mqc0yDqJvDFCg=" 852 | }, 853 | "is-binary-path": { 854 | "version": "1.0.1", 855 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", 856 | "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=" 857 | }, 858 | "is-buffer": { 859 | "version": "1.1.5", 860 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", 861 | "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" 862 | }, 863 | "is-dotfile": { 864 | "version": "1.0.3", 865 | "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", 866 | "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" 867 | }, 868 | "is-equal-shallow": { 869 | "version": "0.1.3", 870 | "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", 871 | "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=" 872 | }, 873 | "is-extendable": { 874 | "version": "0.1.1", 875 | "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", 876 | "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" 877 | }, 878 | "is-extglob": { 879 | "version": "1.0.0", 880 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", 881 | "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" 882 | }, 883 | "is-finite": { 884 | "version": "1.0.2", 885 | "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", 886 | "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=" 887 | }, 888 | "is-glob": { 889 | "version": "2.0.1", 890 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", 891 | "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=" 892 | }, 893 | "is-npm": { 894 | "version": "1.0.0", 895 | "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", 896 | "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" 897 | }, 898 | "is-number": { 899 | "version": "2.1.0", 900 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", 901 | "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=" 902 | }, 903 | "is-posix-bracket": { 904 | "version": "0.1.1", 905 | "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", 906 | "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" 907 | }, 908 | "is-primitive": { 909 | "version": "2.0.0", 910 | "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", 911 | "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" 912 | }, 913 | "is-redirect": { 914 | "version": "1.0.0", 915 | "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", 916 | "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" 917 | }, 918 | "is-stream": { 919 | "version": "1.1.0", 920 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 921 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 922 | }, 923 | "isarray": { 924 | "version": "1.0.0", 925 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 926 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 927 | }, 928 | "isemail": { 929 | "version": "2.2.1", 930 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", 931 | "integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY=" 932 | }, 933 | "isobject": { 934 | "version": "2.1.0", 935 | "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", 936 | "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=" 937 | }, 938 | "items": { 939 | "version": "2.1.1", 940 | "resolved": "https://registry.npmjs.org/items/-/items-2.1.1.tgz", 941 | "integrity": "sha1-i9FtnIOxlSneWuoyGsqtp4NkoZg=" 942 | }, 943 | "joi": { 944 | "version": "10.6.0", 945 | "resolved": "https://registry.npmjs.org/joi/-/joi-10.6.0.tgz", 946 | "integrity": "sha512-hBF3LcqyAid+9X/pwg+eXjD2QBZI5eXnBFJYaAkH4SK3mp9QSRiiQnDYlmlz5pccMvnLcJRS4whhDOTCkmsAdQ==" 947 | }, 948 | "kind-of": { 949 | "version": "3.2.2", 950 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 951 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" 952 | }, 953 | "latest-version": { 954 | "version": "1.0.1", 955 | "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", 956 | "integrity": "sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs=" 957 | }, 958 | "lodash._baseassign": { 959 | "version": "3.2.0", 960 | "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", 961 | "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=" 962 | }, 963 | "lodash._basecopy": { 964 | "version": "3.0.1", 965 | "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", 966 | "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" 967 | }, 968 | "lodash._bindcallback": { 969 | "version": "3.0.1", 970 | "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", 971 | "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=" 972 | }, 973 | "lodash._createassigner": { 974 | "version": "3.1.1", 975 | "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", 976 | "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=" 977 | }, 978 | "lodash._getnative": { 979 | "version": "3.9.1", 980 | "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", 981 | "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" 982 | }, 983 | "lodash._isiterateecall": { 984 | "version": "3.0.9", 985 | "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", 986 | "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" 987 | }, 988 | "lodash.assign": { 989 | "version": "3.2.0", 990 | "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", 991 | "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=" 992 | }, 993 | "lodash.defaults": { 994 | "version": "3.1.2", 995 | "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", 996 | "integrity": "sha1-xzCLGNv4vJNy1wGnNJPGEZK9Liw=" 997 | }, 998 | "lodash.isarguments": { 999 | "version": "3.1.0", 1000 | "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", 1001 | "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" 1002 | }, 1003 | "lodash.isarray": { 1004 | "version": "3.0.4", 1005 | "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", 1006 | "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" 1007 | }, 1008 | "lodash.keys": { 1009 | "version": "3.1.2", 1010 | "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", 1011 | "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=" 1012 | }, 1013 | "lodash.restparam": { 1014 | "version": "3.6.1", 1015 | "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", 1016 | "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" 1017 | }, 1018 | "lowercase-keys": { 1019 | "version": "1.0.0", 1020 | "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", 1021 | "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" 1022 | }, 1023 | "lru-cache": { 1024 | "version": "4.0.2", 1025 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", 1026 | "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=" 1027 | }, 1028 | "map-stream": { 1029 | "version": "0.1.0", 1030 | "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", 1031 | "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" 1032 | }, 1033 | "micromatch": { 1034 | "version": "2.3.11", 1035 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", 1036 | "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=" 1037 | }, 1038 | "mime-db": { 1039 | "version": "1.28.0", 1040 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.28.0.tgz", 1041 | "integrity": "sha1-/t00m+BtKGW3/FfYN8beTxfXrDw=" 1042 | }, 1043 | "mimos": { 1044 | "version": "3.0.3", 1045 | "resolved": "https://registry.npmjs.org/mimos/-/mimos-3.0.3.tgz", 1046 | "integrity": "sha1-uRCQcq03jCty9qAQHEPd+ys2ZB8=" 1047 | }, 1048 | "minimatch": { 1049 | "version": "3.0.4", 1050 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 1051 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==" 1052 | }, 1053 | "minimist": { 1054 | "version": "0.0.8", 1055 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 1056 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 1057 | }, 1058 | "mkdirp": { 1059 | "version": "0.5.1", 1060 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 1061 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=" 1062 | }, 1063 | "ms": { 1064 | "version": "2.0.0", 1065 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1066 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 1067 | }, 1068 | "nan": { 1069 | "version": "2.6.2", 1070 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", 1071 | "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", 1072 | "optional": true 1073 | }, 1074 | "nested-error-stacks": { 1075 | "version": "1.0.2", 1076 | "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", 1077 | "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=" 1078 | }, 1079 | "nigel": { 1080 | "version": "2.0.2", 1081 | "resolved": "https://registry.npmjs.org/nigel/-/nigel-2.0.2.tgz", 1082 | "integrity": "sha1-k6GGb7DFLYc5CqdeKxYfS1x15bE=" 1083 | }, 1084 | "nodemon": { 1085 | "version": "1.11.0", 1086 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", 1087 | "integrity": "sha1-ImxWK9KnsT09dRi0mtSCijYj0Gw=" 1088 | }, 1089 | "nopt": { 1090 | "version": "1.0.10", 1091 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 1092 | "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=" 1093 | }, 1094 | "normalize-path": { 1095 | "version": "2.1.1", 1096 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", 1097 | "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=" 1098 | }, 1099 | "number-is-nan": { 1100 | "version": "1.0.1", 1101 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 1102 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 1103 | }, 1104 | "object-assign": { 1105 | "version": "4.1.1", 1106 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1107 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 1108 | }, 1109 | "object.omit": { 1110 | "version": "2.0.1", 1111 | "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", 1112 | "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=" 1113 | }, 1114 | "once": { 1115 | "version": "1.3.3", 1116 | "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", 1117 | "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=" 1118 | }, 1119 | "os-homedir": { 1120 | "version": "1.0.2", 1121 | "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", 1122 | "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" 1123 | }, 1124 | "os-tmpdir": { 1125 | "version": "1.0.2", 1126 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 1127 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 1128 | }, 1129 | "osenv": { 1130 | "version": "0.1.4", 1131 | "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", 1132 | "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=" 1133 | }, 1134 | "package-json": { 1135 | "version": "1.2.0", 1136 | "resolved": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", 1137 | "integrity": "sha1-yOysCUInzfdqMWh07QXifMk5oOA=" 1138 | }, 1139 | "parse-glob": { 1140 | "version": "3.0.4", 1141 | "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", 1142 | "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=" 1143 | }, 1144 | "path-is-absolute": { 1145 | "version": "1.0.1", 1146 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1147 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 1148 | }, 1149 | "pause-stream": { 1150 | "version": "0.0.11", 1151 | "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", 1152 | "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=" 1153 | }, 1154 | "pez": { 1155 | "version": "2.1.5", 1156 | "resolved": "https://registry.npmjs.org/pez/-/pez-2.1.5.tgz", 1157 | "integrity": "sha1-XsLMYlAMw+tCNtSkFM9aF7XrUAc=" 1158 | }, 1159 | "pinkie": { 1160 | "version": "2.0.4", 1161 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", 1162 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" 1163 | }, 1164 | "pinkie-promise": { 1165 | "version": "2.0.1", 1166 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", 1167 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=" 1168 | }, 1169 | "podium": { 1170 | "version": "1.2.5", 1171 | "resolved": "https://registry.npmjs.org/podium/-/podium-1.2.5.tgz", 1172 | "integrity": "sha1-h8VmwvA2W88KHsdgLE0BlIzdKtU=" 1173 | }, 1174 | "prepend-http": { 1175 | "version": "1.0.4", 1176 | "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", 1177 | "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" 1178 | }, 1179 | "preserve": { 1180 | "version": "0.2.0", 1181 | "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", 1182 | "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" 1183 | }, 1184 | "process-nextick-args": { 1185 | "version": "1.0.7", 1186 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", 1187 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" 1188 | }, 1189 | "ps-tree": { 1190 | "version": "1.1.0", 1191 | "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", 1192 | "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=" 1193 | }, 1194 | "pseudomap": { 1195 | "version": "1.0.2", 1196 | "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", 1197 | "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" 1198 | }, 1199 | "randomatic": { 1200 | "version": "1.1.7", 1201 | "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", 1202 | "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", 1203 | "dependencies": { 1204 | "is-number": { 1205 | "version": "3.0.0", 1206 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", 1207 | "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", 1208 | "dependencies": { 1209 | "kind-of": { 1210 | "version": "3.2.2", 1211 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 1212 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" 1213 | } 1214 | } 1215 | }, 1216 | "kind-of": { 1217 | "version": "4.0.0", 1218 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", 1219 | "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=" 1220 | } 1221 | } 1222 | }, 1223 | "rc": { 1224 | "version": "1.2.1", 1225 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", 1226 | "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", 1227 | "dependencies": { 1228 | "minimist": { 1229 | "version": "1.2.0", 1230 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 1231 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 1232 | } 1233 | } 1234 | }, 1235 | "read-all-stream": { 1236 | "version": "3.1.0", 1237 | "resolved": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", 1238 | "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=" 1239 | }, 1240 | "readable-stream": { 1241 | "version": "2.2.11", 1242 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.11.tgz", 1243 | "integrity": "sha512-h+8+r3MKEhkiVrwdKL8aWs1oc1VvBu33ueshOvS26RsZQ3Amhx/oO3TKe4lApSV9ueY6as8EAh7mtuFjdlhg9Q==" 1244 | }, 1245 | "readdirp": { 1246 | "version": "2.1.0", 1247 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", 1248 | "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=" 1249 | }, 1250 | "regex-cache": { 1251 | "version": "0.4.3", 1252 | "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", 1253 | "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=" 1254 | }, 1255 | "registry-url": { 1256 | "version": "3.1.0", 1257 | "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", 1258 | "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=" 1259 | }, 1260 | "remove-trailing-separator": { 1261 | "version": "1.0.2", 1262 | "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", 1263 | "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=" 1264 | }, 1265 | "repeat-element": { 1266 | "version": "1.1.2", 1267 | "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", 1268 | "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" 1269 | }, 1270 | "repeat-string": { 1271 | "version": "1.6.1", 1272 | "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", 1273 | "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" 1274 | }, 1275 | "repeating": { 1276 | "version": "1.1.3", 1277 | "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", 1278 | "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=" 1279 | }, 1280 | "safe-buffer": { 1281 | "version": "5.0.1", 1282 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", 1283 | "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=" 1284 | }, 1285 | "semver": { 1286 | "version": "5.3.0", 1287 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", 1288 | "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" 1289 | }, 1290 | "semver-diff": { 1291 | "version": "2.1.0", 1292 | "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", 1293 | "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=" 1294 | }, 1295 | "set-immediate-shim": { 1296 | "version": "1.0.1", 1297 | "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", 1298 | "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" 1299 | }, 1300 | "shot": { 1301 | "version": "3.4.2", 1302 | "resolved": "https://registry.npmjs.org/shot/-/shot-3.4.2.tgz", 1303 | "integrity": "sha1-Hlw/bysmZJrcQvfrNQIUpaApHWc=" 1304 | }, 1305 | "slide": { 1306 | "version": "1.1.6", 1307 | "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", 1308 | "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" 1309 | }, 1310 | "split": { 1311 | "version": "0.3.3", 1312 | "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", 1313 | "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=" 1314 | }, 1315 | "statehood": { 1316 | "version": "5.0.2", 1317 | "resolved": "https://registry.npmjs.org/statehood/-/statehood-5.0.2.tgz", 1318 | "integrity": "sha1-xrO6oW7YsSHT8Jo/+oXiIZWn8qk=" 1319 | }, 1320 | "stream-combiner": { 1321 | "version": "0.0.4", 1322 | "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", 1323 | "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=" 1324 | }, 1325 | "stream-shift": { 1326 | "version": "1.0.0", 1327 | "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", 1328 | "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" 1329 | }, 1330 | "string_decoder": { 1331 | "version": "1.0.2", 1332 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.2.tgz", 1333 | "integrity": "sha1-sp4fThEl+pehA4K4pTNze3SR4Xk=" 1334 | }, 1335 | "string-length": { 1336 | "version": "1.0.1", 1337 | "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", 1338 | "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=" 1339 | }, 1340 | "strip-ansi": { 1341 | "version": "3.0.1", 1342 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1343 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=" 1344 | }, 1345 | "strip-json-comments": { 1346 | "version": "2.0.1", 1347 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1348 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 1349 | }, 1350 | "subtext": { 1351 | "version": "4.4.1", 1352 | "resolved": "https://registry.npmjs.org/subtext/-/subtext-4.4.1.tgz", 1353 | "integrity": "sha1-L87JRd5CkoPD0YsVH/D6HxuHrsk=" 1354 | }, 1355 | "supports-color": { 1356 | "version": "2.0.0", 1357 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 1358 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" 1359 | }, 1360 | "through": { 1361 | "version": "2.3.8", 1362 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1363 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 1364 | }, 1365 | "timed-out": { 1366 | "version": "2.0.0", 1367 | "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", 1368 | "integrity": "sha1-84sK6B03R9YoAB9B2vxlKs5nHAo=" 1369 | }, 1370 | "topo": { 1371 | "version": "2.0.2", 1372 | "resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz", 1373 | "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=" 1374 | }, 1375 | "touch": { 1376 | "version": "1.0.0", 1377 | "resolved": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", 1378 | "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=" 1379 | }, 1380 | "undefsafe": { 1381 | "version": "0.0.3", 1382 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", 1383 | "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=" 1384 | }, 1385 | "update-notifier": { 1386 | "version": "0.5.0", 1387 | "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", 1388 | "integrity": "sha1-B7XcIGazYnqztPUwEw9+3doHpMw=" 1389 | }, 1390 | "util-deprecate": { 1391 | "version": "1.0.2", 1392 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1393 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1394 | }, 1395 | "uuid": { 1396 | "version": "2.0.3", 1397 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", 1398 | "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" 1399 | }, 1400 | "vise": { 1401 | "version": "2.0.2", 1402 | "resolved": "https://registry.npmjs.org/vise/-/vise-2.0.2.tgz", 1403 | "integrity": "sha1-awjo+0y3bjpQzW3Q7DczjoEaDTk=" 1404 | }, 1405 | "wrappy": { 1406 | "version": "1.0.2", 1407 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1408 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1409 | }, 1410 | "wreck": { 1411 | "version": "12.2.2", 1412 | "resolved": "https://registry.npmjs.org/wreck/-/wreck-12.2.2.tgz", 1413 | "integrity": "sha1-4hgj00w21nIATu+jR66MT2BQ49s=" 1414 | }, 1415 | "write-file-atomic": { 1416 | "version": "1.3.4", 1417 | "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", 1418 | "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=" 1419 | }, 1420 | "xdg-basedir": { 1421 | "version": "2.0.0", 1422 | "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", 1423 | "integrity": "sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I=" 1424 | }, 1425 | "yallist": { 1426 | "version": "2.1.2", 1427 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", 1428 | "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" 1429 | } 1430 | } 1431 | } 1432 | -------------------------------------------------------------------------------- /example-complete/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "dev": "nodemon src/start.js", 9 | "start": "node src/start" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "hapi": "^16.4.3", 15 | "inert": "^4.2.0", 16 | "nodemon": "^1.11.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example-complete/public/example.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | 3 | # Offline cache v1 4 | CACHE: 5 | # html files 6 | index.html 7 | 8 | # css files 9 | styles.css 10 | 11 | # js files 12 | script.js 13 | 14 | NETWORK: 15 | * 16 | # v0.0.29 17 | -------------------------------------------------------------------------------- /example-complete/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | Offline first example 11 | 12 | 13 | 14 | 15 |

0

16 | 17 | 18 |

19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /example-complete/public/script.js: -------------------------------------------------------------------------------- 1 | // Store application cache as a handy short variable 2 | var appCache = window.applicationCache; 3 | // Only run if the appCache isn't busy 4 | if (appCache.status === appCache.IDLE) { 5 | // Force check for an update 6 | appCache.update(); 7 | } 8 | // Check for an available cache update 9 | if (appCache.status === appCache.UPDATEREADY) { 10 | // Save the new content to the cache 11 | appCache.swapCache(); 12 | } 13 | // Listen for updates 14 | appCache.addEventListener('updateready', function(e) { 15 | // Reload the page when the cache is updated 16 | window.location.reload(); 17 | }); 18 | 19 | // ----- Counter stuff 20 | 21 | // Get the buttons and the count display 22 | var incDom = document.querySelector('.increment'); 23 | var decDom = document.querySelector('.decrement'); 24 | var count = document.querySelector('.count'); 25 | // Initialise the counter 26 | var model = 0; 27 | 28 | var storedModel = window.localStorage.getItem('model'); 29 | // Check if there's a storedModel 30 | if (storedModel) { 31 | // Variables coming from localStorage are always strings so we'll need to 32 | // turn it into a number if we want to use it with our counter 33 | model = Number(storedModel); 34 | // Update the counter 35 | update(model, count); 36 | } 37 | 38 | // Increment the counter 39 | function inc(model) { 40 | return model + 1; 41 | } 42 | 43 | // Decrement the counter 44 | function dec(model) { 45 | return model - 1; 46 | } 47 | 48 | // Update both the counter and the model 49 | function update(newModel, element) { 50 | model = newModel; 51 | element.textContent = model; 52 | window.localStorage.setItem('model', model); 53 | } 54 | 55 | // Increment the counter when there's a click event on the + button 56 | incDom.addEventListener('click', function() { 57 | update(inc(model), count); 58 | }); 59 | 60 | // decrement the counter when there's a click event on the - button 61 | decDom.addEventListener('click', function() { 62 | update(dec(model), count); 63 | }); 64 | 65 | // get the online status element from the DOM 66 | var onlineStatusDom = document.querySelector('.online-status'); 67 | // navigator.onLine will be true when online and false when offline. We update the text in the online status element in the dom to reflect the online status from navigator.onLine 68 | if (navigator.onLine) { 69 | onlineStatusDom.textContent = 'online'; 70 | } else { 71 | onlineStatusDom.textContent = 'offline'; 72 | } 73 | 74 | // we use the 'online' and 'offline' events to update the online/offline notification to the user 75 | // in IE8 the offline/online events exist on document.body rather than window, so make sure to reflect that in your code! 76 | window.addEventListener('offline', function(e) { 77 | onlineStatusDom.textContent = 'offline'; 78 | }); 79 | 80 | window.addEventListener('online', function(e) { 81 | onlineStatusDom.textContent = 'online'; 82 | }); 83 | 84 | /* istanbul ignore next */ 85 | if (typeof module !== 'undefined' && module.exports) { 86 | module.exports = { 87 | inc: inc, 88 | dec: dec, 89 | update: update, 90 | }; 91 | } 92 | -------------------------------------------------------------------------------- /example-complete/public/styles.css: -------------------------------------------------------------------------------- 1 | body, .increment, .decrement { 2 | background-color: #4DB6AC; /* dwyl teal see: color-hex.com/color/4db6ac */ 3 | color: white 4 | } 5 | 6 | .increment, .decrement { 7 | display: inline-block; 8 | width: 2rem; 9 | height: 2rem; 10 | border-style: none; 11 | border: solid white; 12 | font-size: 1.5rem; 13 | line-height: 1; 14 | font-weight: 600; 15 | } 16 | 17 | .count { 18 | display: inline-block; 19 | width: auto; 20 | height: 2rem; 21 | text-align: center; 22 | line-height: 1; 23 | font-size: 1.5rem; 24 | font-weight: 600; 25 | padding: 0.5rem; 26 | margin: 0; 27 | } 28 | -------------------------------------------------------------------------------- /example-complete/src/router.js: -------------------------------------------------------------------------------- 1 | const serveHome = { 2 | method: 'GET', 3 | path: '/', 4 | handler: (request, reply) => { 5 | reply.file('./public/index.html'); 6 | }, 7 | }; 8 | 9 | const servePublic = { 10 | method: 'GET', 11 | path: '/{file*}', 12 | handler: { 13 | directory: { 14 | path: './public', 15 | }, 16 | }, 17 | }; 18 | 19 | module.exports = [serveHome, servePublic]; 20 | -------------------------------------------------------------------------------- /example-complete/src/server.js: -------------------------------------------------------------------------------- 1 | const hapi = require('hapi'); 2 | const inert = require('inert'); 3 | const server = new hapi.Server(); 4 | 5 | const router = require('./router'); 6 | 7 | server.connection({ 8 | port: process.env.PORT || 4000, 9 | }); 10 | 11 | server.register([inert], err => { 12 | if (err) throw err; 13 | 14 | server.route(router); 15 | }); 16 | 17 | module.exports = server; 18 | -------------------------------------------------------------------------------- /example-complete/src/start.js: -------------------------------------------------------------------------------- 1 | const server = require('./server'); 2 | 3 | server.start(err => { 4 | if (err) throw err; 5 | 6 | console.log(`Server started on port ${server.info.uri}`); 7 | }); 8 | -------------------------------------------------------------------------------- /example/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "abbrev": { 7 | "version": "1.1.0", 8 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", 9 | "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=" 10 | }, 11 | "accept": { 12 | "version": "2.1.4", 13 | "resolved": "https://registry.npmjs.org/accept/-/accept-2.1.4.tgz", 14 | "integrity": "sha1-iHr1TO7lx/RDBGGXHsQAxh0JrLs=" 15 | }, 16 | "ammo": { 17 | "version": "2.0.4", 18 | "resolved": "https://registry.npmjs.org/ammo/-/ammo-2.0.4.tgz", 19 | "integrity": "sha1-v4CqshFpjqePY+9efxE91dnokX8=" 20 | }, 21 | "ansi-regex": { 22 | "version": "2.1.1", 23 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 24 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 25 | }, 26 | "ansi-styles": { 27 | "version": "2.2.1", 28 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 29 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" 30 | }, 31 | "anymatch": { 32 | "version": "1.3.0", 33 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", 34 | "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=" 35 | }, 36 | "arr-diff": { 37 | "version": "2.0.0", 38 | "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", 39 | "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=" 40 | }, 41 | "arr-flatten": { 42 | "version": "1.0.3", 43 | "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.3.tgz", 44 | "integrity": "sha1-onTthawIhJtr14R8RYB0XcUa37E=" 45 | }, 46 | "array-unique": { 47 | "version": "0.2.1", 48 | "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", 49 | "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" 50 | }, 51 | "arrify": { 52 | "version": "1.0.1", 53 | "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", 54 | "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" 55 | }, 56 | "async-each": { 57 | "version": "1.0.1", 58 | "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", 59 | "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" 60 | }, 61 | "b64": { 62 | "version": "3.0.2", 63 | "resolved": "https://registry.npmjs.org/b64/-/b64-3.0.2.tgz", 64 | "integrity": "sha1-ep1gRmrfe43hFMvfZRpf38yQiU0=" 65 | }, 66 | "balanced-match": { 67 | "version": "1.0.0", 68 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 69 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 70 | }, 71 | "binary-extensions": { 72 | "version": "1.8.0", 73 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", 74 | "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=" 75 | }, 76 | "boom": { 77 | "version": "5.1.0", 78 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.1.0.tgz", 79 | "integrity": "sha1-Awj6jpJM1tQtnDv0iDvcmPDnHfg=" 80 | }, 81 | "brace-expansion": { 82 | "version": "1.1.8", 83 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", 84 | "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=" 85 | }, 86 | "braces": { 87 | "version": "1.8.5", 88 | "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", 89 | "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=" 90 | }, 91 | "call": { 92 | "version": "4.0.2", 93 | "resolved": "https://registry.npmjs.org/call/-/call-4.0.2.tgz", 94 | "integrity": "sha1-33b19R7o3Ui4VqyEAPfmnm1zmcQ=" 95 | }, 96 | "catbox": { 97 | "version": "7.1.4", 98 | "resolved": "https://registry.npmjs.org/catbox/-/catbox-7.1.4.tgz", 99 | "integrity": "sha1-ipUO0YtkuoCIwa4TLoXFhHnStsw=" 100 | }, 101 | "catbox-memory": { 102 | "version": "2.0.4", 103 | "resolved": "https://registry.npmjs.org/catbox-memory/-/catbox-memory-2.0.4.tgz", 104 | "integrity": "sha1-Qz4lWQLK9UIz0ShkKcj03xToItU=" 105 | }, 106 | "chalk": { 107 | "version": "1.1.3", 108 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 109 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=" 110 | }, 111 | "chokidar": { 112 | "version": "1.7.0", 113 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", 114 | "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=" 115 | }, 116 | "concat-map": { 117 | "version": "0.0.1", 118 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 119 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 120 | }, 121 | "configstore": { 122 | "version": "1.4.0", 123 | "resolved": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", 124 | "integrity": "sha1-w1eB0FAdJowlxUuLF/YkDopPsCE=" 125 | }, 126 | "content": { 127 | "version": "3.0.4", 128 | "resolved": "https://registry.npmjs.org/content/-/content-3.0.4.tgz", 129 | "integrity": "sha1-yj3eBEgPElGbcVJuxEvUiN37P+8=" 130 | }, 131 | "core-util-is": { 132 | "version": "1.0.2", 133 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 134 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 135 | }, 136 | "cryptiles": { 137 | "version": "3.1.2", 138 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", 139 | "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=" 140 | }, 141 | "debug": { 142 | "version": "2.6.8", 143 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", 144 | "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=" 145 | }, 146 | "deep-extend": { 147 | "version": "0.4.2", 148 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", 149 | "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" 150 | }, 151 | "duplexer": { 152 | "version": "0.1.1", 153 | "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", 154 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" 155 | }, 156 | "duplexify": { 157 | "version": "3.5.0", 158 | "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", 159 | "integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=" 160 | }, 161 | "end-of-stream": { 162 | "version": "1.0.0", 163 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", 164 | "integrity": "sha1-1FlucCc0qT5A6a+GQxnqvZn/Lw4=" 165 | }, 166 | "es6-promise": { 167 | "version": "3.3.1", 168 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", 169 | "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=" 170 | }, 171 | "escape-string-regexp": { 172 | "version": "1.0.5", 173 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 174 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 175 | }, 176 | "event-stream": { 177 | "version": "3.3.4", 178 | "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", 179 | "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=" 180 | }, 181 | "expand-brackets": { 182 | "version": "0.1.5", 183 | "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", 184 | "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=" 185 | }, 186 | "expand-range": { 187 | "version": "1.8.2", 188 | "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", 189 | "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=" 190 | }, 191 | "extglob": { 192 | "version": "0.3.2", 193 | "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", 194 | "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=" 195 | }, 196 | "filename-regex": { 197 | "version": "2.0.1", 198 | "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", 199 | "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" 200 | }, 201 | "fill-range": { 202 | "version": "2.2.3", 203 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", 204 | "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=" 205 | }, 206 | "for-in": { 207 | "version": "1.0.2", 208 | "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", 209 | "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" 210 | }, 211 | "for-own": { 212 | "version": "0.1.5", 213 | "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", 214 | "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=" 215 | }, 216 | "from": { 217 | "version": "0.1.7", 218 | "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", 219 | "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" 220 | }, 221 | "fsevents": { 222 | "version": "1.1.2", 223 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", 224 | "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", 225 | "optional": true, 226 | "dependencies": { 227 | "abbrev": { 228 | "version": "1.1.0", 229 | "bundled": true, 230 | "optional": true 231 | }, 232 | "ajv": { 233 | "version": "4.11.8", 234 | "bundled": true, 235 | "optional": true 236 | }, 237 | "ansi-regex": { 238 | "version": "2.1.1", 239 | "bundled": true 240 | }, 241 | "aproba": { 242 | "version": "1.1.1", 243 | "bundled": true, 244 | "optional": true 245 | }, 246 | "are-we-there-yet": { 247 | "version": "1.1.4", 248 | "bundled": true, 249 | "optional": true 250 | }, 251 | "asn1": { 252 | "version": "0.2.3", 253 | "bundled": true, 254 | "optional": true 255 | }, 256 | "assert-plus": { 257 | "version": "0.2.0", 258 | "bundled": true, 259 | "optional": true 260 | }, 261 | "asynckit": { 262 | "version": "0.4.0", 263 | "bundled": true, 264 | "optional": true 265 | }, 266 | "aws-sign2": { 267 | "version": "0.6.0", 268 | "bundled": true, 269 | "optional": true 270 | }, 271 | "aws4": { 272 | "version": "1.6.0", 273 | "bundled": true, 274 | "optional": true 275 | }, 276 | "balanced-match": { 277 | "version": "0.4.2", 278 | "bundled": true 279 | }, 280 | "bcrypt-pbkdf": { 281 | "version": "1.0.1", 282 | "bundled": true, 283 | "optional": true 284 | }, 285 | "block-stream": { 286 | "version": "0.0.9", 287 | "bundled": true 288 | }, 289 | "boom": { 290 | "version": "2.10.1", 291 | "bundled": true 292 | }, 293 | "brace-expansion": { 294 | "version": "1.1.7", 295 | "bundled": true 296 | }, 297 | "buffer-shims": { 298 | "version": "1.0.0", 299 | "bundled": true 300 | }, 301 | "caseless": { 302 | "version": "0.12.0", 303 | "bundled": true, 304 | "optional": true 305 | }, 306 | "co": { 307 | "version": "4.6.0", 308 | "bundled": true, 309 | "optional": true 310 | }, 311 | "code-point-at": { 312 | "version": "1.1.0", 313 | "bundled": true 314 | }, 315 | "combined-stream": { 316 | "version": "1.0.5", 317 | "bundled": true 318 | }, 319 | "concat-map": { 320 | "version": "0.0.1", 321 | "bundled": true 322 | }, 323 | "console-control-strings": { 324 | "version": "1.1.0", 325 | "bundled": true 326 | }, 327 | "core-util-is": { 328 | "version": "1.0.2", 329 | "bundled": true 330 | }, 331 | "cryptiles": { 332 | "version": "2.0.5", 333 | "bundled": true, 334 | "optional": true 335 | }, 336 | "dashdash": { 337 | "version": "1.14.1", 338 | "bundled": true, 339 | "optional": true, 340 | "dependencies": { 341 | "assert-plus": { 342 | "version": "1.0.0", 343 | "bundled": true, 344 | "optional": true 345 | } 346 | } 347 | }, 348 | "debug": { 349 | "version": "2.6.8", 350 | "bundled": true, 351 | "optional": true 352 | }, 353 | "deep-extend": { 354 | "version": "0.4.2", 355 | "bundled": true, 356 | "optional": true 357 | }, 358 | "delayed-stream": { 359 | "version": "1.0.0", 360 | "bundled": true 361 | }, 362 | "delegates": { 363 | "version": "1.0.0", 364 | "bundled": true, 365 | "optional": true 366 | }, 367 | "ecc-jsbn": { 368 | "version": "0.1.1", 369 | "bundled": true, 370 | "optional": true 371 | }, 372 | "extend": { 373 | "version": "3.0.1", 374 | "bundled": true, 375 | "optional": true 376 | }, 377 | "extsprintf": { 378 | "version": "1.0.2", 379 | "bundled": true 380 | }, 381 | "forever-agent": { 382 | "version": "0.6.1", 383 | "bundled": true, 384 | "optional": true 385 | }, 386 | "form-data": { 387 | "version": "2.1.4", 388 | "bundled": true, 389 | "optional": true 390 | }, 391 | "fs.realpath": { 392 | "version": "1.0.0", 393 | "bundled": true 394 | }, 395 | "fstream": { 396 | "version": "1.0.11", 397 | "bundled": true 398 | }, 399 | "fstream-ignore": { 400 | "version": "1.0.5", 401 | "bundled": true, 402 | "optional": true 403 | }, 404 | "gauge": { 405 | "version": "2.7.4", 406 | "bundled": true, 407 | "optional": true 408 | }, 409 | "getpass": { 410 | "version": "0.1.7", 411 | "bundled": true, 412 | "optional": true, 413 | "dependencies": { 414 | "assert-plus": { 415 | "version": "1.0.0", 416 | "bundled": true, 417 | "optional": true 418 | } 419 | } 420 | }, 421 | "glob": { 422 | "version": "7.1.2", 423 | "bundled": true 424 | }, 425 | "graceful-fs": { 426 | "version": "4.1.11", 427 | "bundled": true 428 | }, 429 | "har-schema": { 430 | "version": "1.0.5", 431 | "bundled": true, 432 | "optional": true 433 | }, 434 | "har-validator": { 435 | "version": "4.2.1", 436 | "bundled": true, 437 | "optional": true 438 | }, 439 | "has-unicode": { 440 | "version": "2.0.1", 441 | "bundled": true, 442 | "optional": true 443 | }, 444 | "hawk": { 445 | "version": "3.1.3", 446 | "bundled": true, 447 | "optional": true 448 | }, 449 | "hoek": { 450 | "version": "2.16.3", 451 | "bundled": true 452 | }, 453 | "http-signature": { 454 | "version": "1.1.1", 455 | "bundled": true, 456 | "optional": true 457 | }, 458 | "inflight": { 459 | "version": "1.0.6", 460 | "bundled": true 461 | }, 462 | "inherits": { 463 | "version": "2.0.3", 464 | "bundled": true 465 | }, 466 | "ini": { 467 | "version": "1.3.4", 468 | "bundled": true, 469 | "optional": true 470 | }, 471 | "is-fullwidth-code-point": { 472 | "version": "1.0.0", 473 | "bundled": true 474 | }, 475 | "is-typedarray": { 476 | "version": "1.0.0", 477 | "bundled": true, 478 | "optional": true 479 | }, 480 | "isarray": { 481 | "version": "1.0.0", 482 | "bundled": true 483 | }, 484 | "isstream": { 485 | "version": "0.1.2", 486 | "bundled": true, 487 | "optional": true 488 | }, 489 | "jodid25519": { 490 | "version": "1.0.2", 491 | "bundled": true, 492 | "optional": true 493 | }, 494 | "jsbn": { 495 | "version": "0.1.1", 496 | "bundled": true, 497 | "optional": true 498 | }, 499 | "json-schema": { 500 | "version": "0.2.3", 501 | "bundled": true, 502 | "optional": true 503 | }, 504 | "json-stable-stringify": { 505 | "version": "1.0.1", 506 | "bundled": true, 507 | "optional": true 508 | }, 509 | "json-stringify-safe": { 510 | "version": "5.0.1", 511 | "bundled": true, 512 | "optional": true 513 | }, 514 | "jsonify": { 515 | "version": "0.0.0", 516 | "bundled": true, 517 | "optional": true 518 | }, 519 | "jsprim": { 520 | "version": "1.4.0", 521 | "bundled": true, 522 | "optional": true, 523 | "dependencies": { 524 | "assert-plus": { 525 | "version": "1.0.0", 526 | "bundled": true, 527 | "optional": true 528 | } 529 | } 530 | }, 531 | "mime-db": { 532 | "version": "1.27.0", 533 | "bundled": true 534 | }, 535 | "mime-types": { 536 | "version": "2.1.15", 537 | "bundled": true 538 | }, 539 | "minimatch": { 540 | "version": "3.0.4", 541 | "bundled": true 542 | }, 543 | "minimist": { 544 | "version": "0.0.8", 545 | "bundled": true 546 | }, 547 | "mkdirp": { 548 | "version": "0.5.1", 549 | "bundled": true 550 | }, 551 | "ms": { 552 | "version": "2.0.0", 553 | "bundled": true, 554 | "optional": true 555 | }, 556 | "node-pre-gyp": { 557 | "version": "0.6.36", 558 | "bundled": true, 559 | "optional": true 560 | }, 561 | "nopt": { 562 | "version": "4.0.1", 563 | "bundled": true, 564 | "optional": true 565 | }, 566 | "npmlog": { 567 | "version": "4.1.0", 568 | "bundled": true, 569 | "optional": true 570 | }, 571 | "number-is-nan": { 572 | "version": "1.0.1", 573 | "bundled": true 574 | }, 575 | "oauth-sign": { 576 | "version": "0.8.2", 577 | "bundled": true, 578 | "optional": true 579 | }, 580 | "object-assign": { 581 | "version": "4.1.1", 582 | "bundled": true, 583 | "optional": true 584 | }, 585 | "once": { 586 | "version": "1.4.0", 587 | "bundled": true 588 | }, 589 | "os-homedir": { 590 | "version": "1.0.2", 591 | "bundled": true, 592 | "optional": true 593 | }, 594 | "os-tmpdir": { 595 | "version": "1.0.2", 596 | "bundled": true, 597 | "optional": true 598 | }, 599 | "osenv": { 600 | "version": "0.1.4", 601 | "bundled": true, 602 | "optional": true 603 | }, 604 | "path-is-absolute": { 605 | "version": "1.0.1", 606 | "bundled": true 607 | }, 608 | "performance-now": { 609 | "version": "0.2.0", 610 | "bundled": true, 611 | "optional": true 612 | }, 613 | "process-nextick-args": { 614 | "version": "1.0.7", 615 | "bundled": true 616 | }, 617 | "punycode": { 618 | "version": "1.4.1", 619 | "bundled": true, 620 | "optional": true 621 | }, 622 | "qs": { 623 | "version": "6.4.0", 624 | "bundled": true, 625 | "optional": true 626 | }, 627 | "rc": { 628 | "version": "1.2.1", 629 | "bundled": true, 630 | "optional": true, 631 | "dependencies": { 632 | "minimist": { 633 | "version": "1.2.0", 634 | "bundled": true, 635 | "optional": true 636 | } 637 | } 638 | }, 639 | "readable-stream": { 640 | "version": "2.2.9", 641 | "bundled": true 642 | }, 643 | "request": { 644 | "version": "2.81.0", 645 | "bundled": true, 646 | "optional": true 647 | }, 648 | "rimraf": { 649 | "version": "2.6.1", 650 | "bundled": true 651 | }, 652 | "safe-buffer": { 653 | "version": "5.0.1", 654 | "bundled": true 655 | }, 656 | "semver": { 657 | "version": "5.3.0", 658 | "bundled": true, 659 | "optional": true 660 | }, 661 | "set-blocking": { 662 | "version": "2.0.0", 663 | "bundled": true, 664 | "optional": true 665 | }, 666 | "signal-exit": { 667 | "version": "3.0.2", 668 | "bundled": true, 669 | "optional": true 670 | }, 671 | "sntp": { 672 | "version": "1.0.9", 673 | "bundled": true, 674 | "optional": true 675 | }, 676 | "sshpk": { 677 | "version": "1.13.0", 678 | "bundled": true, 679 | "optional": true, 680 | "dependencies": { 681 | "assert-plus": { 682 | "version": "1.0.0", 683 | "bundled": true, 684 | "optional": true 685 | } 686 | } 687 | }, 688 | "string_decoder": { 689 | "version": "1.0.1", 690 | "bundled": true 691 | }, 692 | "string-width": { 693 | "version": "1.0.2", 694 | "bundled": true 695 | }, 696 | "stringstream": { 697 | "version": "0.0.5", 698 | "bundled": true, 699 | "optional": true 700 | }, 701 | "strip-ansi": { 702 | "version": "3.0.1", 703 | "bundled": true 704 | }, 705 | "strip-json-comments": { 706 | "version": "2.0.1", 707 | "bundled": true, 708 | "optional": true 709 | }, 710 | "tar": { 711 | "version": "2.2.1", 712 | "bundled": true 713 | }, 714 | "tar-pack": { 715 | "version": "3.4.0", 716 | "bundled": true, 717 | "optional": true 718 | }, 719 | "tough-cookie": { 720 | "version": "2.3.2", 721 | "bundled": true, 722 | "optional": true 723 | }, 724 | "tunnel-agent": { 725 | "version": "0.6.0", 726 | "bundled": true, 727 | "optional": true 728 | }, 729 | "tweetnacl": { 730 | "version": "0.14.5", 731 | "bundled": true, 732 | "optional": true 733 | }, 734 | "uid-number": { 735 | "version": "0.0.6", 736 | "bundled": true, 737 | "optional": true 738 | }, 739 | "util-deprecate": { 740 | "version": "1.0.2", 741 | "bundled": true 742 | }, 743 | "uuid": { 744 | "version": "3.0.1", 745 | "bundled": true, 746 | "optional": true 747 | }, 748 | "verror": { 749 | "version": "1.3.6", 750 | "bundled": true, 751 | "optional": true 752 | }, 753 | "wide-align": { 754 | "version": "1.1.2", 755 | "bundled": true, 756 | "optional": true 757 | }, 758 | "wrappy": { 759 | "version": "1.0.2", 760 | "bundled": true 761 | } 762 | } 763 | }, 764 | "glob-base": { 765 | "version": "0.3.0", 766 | "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", 767 | "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=" 768 | }, 769 | "glob-parent": { 770 | "version": "2.0.0", 771 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", 772 | "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=" 773 | }, 774 | "got": { 775 | "version": "3.3.1", 776 | "resolved": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", 777 | "integrity": "sha1-5dDtSvVfw+701WAHdp2YGSvLLso=", 778 | "dependencies": { 779 | "object-assign": { 780 | "version": "3.0.0", 781 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", 782 | "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" 783 | } 784 | } 785 | }, 786 | "graceful-fs": { 787 | "version": "4.1.11", 788 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", 789 | "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" 790 | }, 791 | "hapi": { 792 | "version": "16.4.3", 793 | "resolved": "https://registry.npmjs.org/hapi/-/hapi-16.4.3.tgz", 794 | "integrity": "sha512-1jN2dj3KeNAHWs5/rFCGPjYyyoDqG1orkwJyL1OHjbODnhsCbZ6AQOgroOUyNUCH3KCZ6dU/dimAW83gJiBjsA==" 795 | }, 796 | "has-ansi": { 797 | "version": "2.0.0", 798 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 799 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=" 800 | }, 801 | "heavy": { 802 | "version": "4.0.4", 803 | "resolved": "https://registry.npmjs.org/heavy/-/heavy-4.0.4.tgz", 804 | "integrity": "sha1-NskTNsAMz+hSyqTRUwhjNc0vAOk=" 805 | }, 806 | "hoek": { 807 | "version": "4.1.1", 808 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.1.1.tgz", 809 | "integrity": "sha1-nMVz/7ore0CPtenCoTeWvpTN3Ok=" 810 | }, 811 | "ignore-by-default": { 812 | "version": "1.0.1", 813 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 814 | "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" 815 | }, 816 | "imurmurhash": { 817 | "version": "0.1.4", 818 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 819 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" 820 | }, 821 | "inert": { 822 | "version": "4.2.0", 823 | "resolved": "https://registry.npmjs.org/inert/-/inert-4.2.0.tgz", 824 | "integrity": "sha1-aqXajOGZgutyqr70vdpk/WdQsAU=", 825 | "dependencies": { 826 | "boom": { 827 | "version": "4.3.1", 828 | "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", 829 | "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=" 830 | } 831 | } 832 | }, 833 | "infinity-agent": { 834 | "version": "2.0.3", 835 | "resolved": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", 836 | "integrity": "sha1-ReDi/3qesDCyfWK3SzdEt6esQhY=" 837 | }, 838 | "inherits": { 839 | "version": "2.0.3", 840 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 841 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 842 | }, 843 | "ini": { 844 | "version": "1.3.4", 845 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", 846 | "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" 847 | }, 848 | "iron": { 849 | "version": "4.0.5", 850 | "resolved": "https://registry.npmjs.org/iron/-/iron-4.0.5.tgz", 851 | "integrity": "sha1-TwQszri5c480a1mqc0yDqJvDFCg=" 852 | }, 853 | "is-binary-path": { 854 | "version": "1.0.1", 855 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", 856 | "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=" 857 | }, 858 | "is-buffer": { 859 | "version": "1.1.5", 860 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", 861 | "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" 862 | }, 863 | "is-dotfile": { 864 | "version": "1.0.3", 865 | "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", 866 | "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" 867 | }, 868 | "is-equal-shallow": { 869 | "version": "0.1.3", 870 | "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", 871 | "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=" 872 | }, 873 | "is-extendable": { 874 | "version": "0.1.1", 875 | "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", 876 | "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" 877 | }, 878 | "is-extglob": { 879 | "version": "1.0.0", 880 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", 881 | "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" 882 | }, 883 | "is-finite": { 884 | "version": "1.0.2", 885 | "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", 886 | "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=" 887 | }, 888 | "is-glob": { 889 | "version": "2.0.1", 890 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", 891 | "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=" 892 | }, 893 | "is-npm": { 894 | "version": "1.0.0", 895 | "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", 896 | "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" 897 | }, 898 | "is-number": { 899 | "version": "2.1.0", 900 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", 901 | "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=" 902 | }, 903 | "is-posix-bracket": { 904 | "version": "0.1.1", 905 | "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", 906 | "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" 907 | }, 908 | "is-primitive": { 909 | "version": "2.0.0", 910 | "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", 911 | "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" 912 | }, 913 | "is-redirect": { 914 | "version": "1.0.0", 915 | "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", 916 | "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" 917 | }, 918 | "is-stream": { 919 | "version": "1.1.0", 920 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 921 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 922 | }, 923 | "isarray": { 924 | "version": "1.0.0", 925 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 926 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 927 | }, 928 | "isemail": { 929 | "version": "2.2.1", 930 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", 931 | "integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY=" 932 | }, 933 | "isobject": { 934 | "version": "2.1.0", 935 | "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", 936 | "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=" 937 | }, 938 | "items": { 939 | "version": "2.1.1", 940 | "resolved": "https://registry.npmjs.org/items/-/items-2.1.1.tgz", 941 | "integrity": "sha1-i9FtnIOxlSneWuoyGsqtp4NkoZg=" 942 | }, 943 | "joi": { 944 | "version": "10.6.0", 945 | "resolved": "https://registry.npmjs.org/joi/-/joi-10.6.0.tgz", 946 | "integrity": "sha512-hBF3LcqyAid+9X/pwg+eXjD2QBZI5eXnBFJYaAkH4SK3mp9QSRiiQnDYlmlz5pccMvnLcJRS4whhDOTCkmsAdQ==" 947 | }, 948 | "kind-of": { 949 | "version": "3.2.2", 950 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 951 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" 952 | }, 953 | "latest-version": { 954 | "version": "1.0.1", 955 | "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", 956 | "integrity": "sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs=" 957 | }, 958 | "lodash._baseassign": { 959 | "version": "3.2.0", 960 | "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", 961 | "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=" 962 | }, 963 | "lodash._basecopy": { 964 | "version": "3.0.1", 965 | "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", 966 | "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" 967 | }, 968 | "lodash._bindcallback": { 969 | "version": "3.0.1", 970 | "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", 971 | "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=" 972 | }, 973 | "lodash._createassigner": { 974 | "version": "3.1.1", 975 | "resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", 976 | "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=" 977 | }, 978 | "lodash._getnative": { 979 | "version": "3.9.1", 980 | "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", 981 | "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" 982 | }, 983 | "lodash._isiterateecall": { 984 | "version": "3.0.9", 985 | "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", 986 | "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" 987 | }, 988 | "lodash.assign": { 989 | "version": "3.2.0", 990 | "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", 991 | "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=" 992 | }, 993 | "lodash.defaults": { 994 | "version": "3.1.2", 995 | "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", 996 | "integrity": "sha1-xzCLGNv4vJNy1wGnNJPGEZK9Liw=" 997 | }, 998 | "lodash.isarguments": { 999 | "version": "3.1.0", 1000 | "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", 1001 | "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" 1002 | }, 1003 | "lodash.isarray": { 1004 | "version": "3.0.4", 1005 | "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", 1006 | "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" 1007 | }, 1008 | "lodash.keys": { 1009 | "version": "3.1.2", 1010 | "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", 1011 | "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=" 1012 | }, 1013 | "lodash.restparam": { 1014 | "version": "3.6.1", 1015 | "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", 1016 | "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" 1017 | }, 1018 | "lowercase-keys": { 1019 | "version": "1.0.0", 1020 | "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", 1021 | "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" 1022 | }, 1023 | "lru-cache": { 1024 | "version": "4.0.2", 1025 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", 1026 | "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=" 1027 | }, 1028 | "map-stream": { 1029 | "version": "0.1.0", 1030 | "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", 1031 | "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" 1032 | }, 1033 | "micromatch": { 1034 | "version": "2.3.11", 1035 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", 1036 | "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=" 1037 | }, 1038 | "mime-db": { 1039 | "version": "1.28.0", 1040 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.28.0.tgz", 1041 | "integrity": "sha1-/t00m+BtKGW3/FfYN8beTxfXrDw=" 1042 | }, 1043 | "mimos": { 1044 | "version": "3.0.3", 1045 | "resolved": "https://registry.npmjs.org/mimos/-/mimos-3.0.3.tgz", 1046 | "integrity": "sha1-uRCQcq03jCty9qAQHEPd+ys2ZB8=" 1047 | }, 1048 | "minimatch": { 1049 | "version": "3.0.4", 1050 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 1051 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==" 1052 | }, 1053 | "minimist": { 1054 | "version": "0.0.8", 1055 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 1056 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 1057 | }, 1058 | "mkdirp": { 1059 | "version": "0.5.1", 1060 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 1061 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=" 1062 | }, 1063 | "ms": { 1064 | "version": "2.0.0", 1065 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1066 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 1067 | }, 1068 | "nan": { 1069 | "version": "2.6.2", 1070 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", 1071 | "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", 1072 | "optional": true 1073 | }, 1074 | "nested-error-stacks": { 1075 | "version": "1.0.2", 1076 | "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", 1077 | "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=" 1078 | }, 1079 | "nigel": { 1080 | "version": "2.0.2", 1081 | "resolved": "https://registry.npmjs.org/nigel/-/nigel-2.0.2.tgz", 1082 | "integrity": "sha1-k6GGb7DFLYc5CqdeKxYfS1x15bE=" 1083 | }, 1084 | "nodemon": { 1085 | "version": "1.11.0", 1086 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", 1087 | "integrity": "sha1-ImxWK9KnsT09dRi0mtSCijYj0Gw=" 1088 | }, 1089 | "nopt": { 1090 | "version": "1.0.10", 1091 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 1092 | "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=" 1093 | }, 1094 | "normalize-path": { 1095 | "version": "2.1.1", 1096 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", 1097 | "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=" 1098 | }, 1099 | "number-is-nan": { 1100 | "version": "1.0.1", 1101 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 1102 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 1103 | }, 1104 | "object-assign": { 1105 | "version": "4.1.1", 1106 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1107 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 1108 | }, 1109 | "object.omit": { 1110 | "version": "2.0.1", 1111 | "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", 1112 | "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=" 1113 | }, 1114 | "once": { 1115 | "version": "1.3.3", 1116 | "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", 1117 | "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=" 1118 | }, 1119 | "os-homedir": { 1120 | "version": "1.0.2", 1121 | "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", 1122 | "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" 1123 | }, 1124 | "os-tmpdir": { 1125 | "version": "1.0.2", 1126 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 1127 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 1128 | }, 1129 | "osenv": { 1130 | "version": "0.1.4", 1131 | "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", 1132 | "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=" 1133 | }, 1134 | "package-json": { 1135 | "version": "1.2.0", 1136 | "resolved": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", 1137 | "integrity": "sha1-yOysCUInzfdqMWh07QXifMk5oOA=" 1138 | }, 1139 | "parse-glob": { 1140 | "version": "3.0.4", 1141 | "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", 1142 | "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=" 1143 | }, 1144 | "path-is-absolute": { 1145 | "version": "1.0.1", 1146 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1147 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 1148 | }, 1149 | "pause-stream": { 1150 | "version": "0.0.11", 1151 | "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", 1152 | "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=" 1153 | }, 1154 | "pez": { 1155 | "version": "2.1.5", 1156 | "resolved": "https://registry.npmjs.org/pez/-/pez-2.1.5.tgz", 1157 | "integrity": "sha1-XsLMYlAMw+tCNtSkFM9aF7XrUAc=" 1158 | }, 1159 | "pinkie": { 1160 | "version": "2.0.4", 1161 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", 1162 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" 1163 | }, 1164 | "pinkie-promise": { 1165 | "version": "2.0.1", 1166 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", 1167 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=" 1168 | }, 1169 | "podium": { 1170 | "version": "1.2.5", 1171 | "resolved": "https://registry.npmjs.org/podium/-/podium-1.2.5.tgz", 1172 | "integrity": "sha1-h8VmwvA2W88KHsdgLE0BlIzdKtU=" 1173 | }, 1174 | "prepend-http": { 1175 | "version": "1.0.4", 1176 | "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", 1177 | "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" 1178 | }, 1179 | "preserve": { 1180 | "version": "0.2.0", 1181 | "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", 1182 | "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" 1183 | }, 1184 | "process-nextick-args": { 1185 | "version": "1.0.7", 1186 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", 1187 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" 1188 | }, 1189 | "ps-tree": { 1190 | "version": "1.1.0", 1191 | "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", 1192 | "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=" 1193 | }, 1194 | "pseudomap": { 1195 | "version": "1.0.2", 1196 | "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", 1197 | "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" 1198 | }, 1199 | "randomatic": { 1200 | "version": "1.1.7", 1201 | "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", 1202 | "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", 1203 | "dependencies": { 1204 | "is-number": { 1205 | "version": "3.0.0", 1206 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", 1207 | "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", 1208 | "dependencies": { 1209 | "kind-of": { 1210 | "version": "3.2.2", 1211 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 1212 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" 1213 | } 1214 | } 1215 | }, 1216 | "kind-of": { 1217 | "version": "4.0.0", 1218 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", 1219 | "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=" 1220 | } 1221 | } 1222 | }, 1223 | "rc": { 1224 | "version": "1.2.1", 1225 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", 1226 | "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", 1227 | "dependencies": { 1228 | "minimist": { 1229 | "version": "1.2.0", 1230 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 1231 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 1232 | } 1233 | } 1234 | }, 1235 | "read-all-stream": { 1236 | "version": "3.1.0", 1237 | "resolved": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", 1238 | "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=" 1239 | }, 1240 | "readable-stream": { 1241 | "version": "2.2.11", 1242 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.11.tgz", 1243 | "integrity": "sha512-h+8+r3MKEhkiVrwdKL8aWs1oc1VvBu33ueshOvS26RsZQ3Amhx/oO3TKe4lApSV9ueY6as8EAh7mtuFjdlhg9Q==" 1244 | }, 1245 | "readdirp": { 1246 | "version": "2.1.0", 1247 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", 1248 | "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=" 1249 | }, 1250 | "regex-cache": { 1251 | "version": "0.4.3", 1252 | "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", 1253 | "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=" 1254 | }, 1255 | "registry-url": { 1256 | "version": "3.1.0", 1257 | "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", 1258 | "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=" 1259 | }, 1260 | "remove-trailing-separator": { 1261 | "version": "1.0.2", 1262 | "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", 1263 | "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=" 1264 | }, 1265 | "repeat-element": { 1266 | "version": "1.1.2", 1267 | "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", 1268 | "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" 1269 | }, 1270 | "repeat-string": { 1271 | "version": "1.6.1", 1272 | "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", 1273 | "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" 1274 | }, 1275 | "repeating": { 1276 | "version": "1.1.3", 1277 | "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", 1278 | "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=" 1279 | }, 1280 | "safe-buffer": { 1281 | "version": "5.0.1", 1282 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", 1283 | "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=" 1284 | }, 1285 | "semver": { 1286 | "version": "5.3.0", 1287 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", 1288 | "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" 1289 | }, 1290 | "semver-diff": { 1291 | "version": "2.1.0", 1292 | "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", 1293 | "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=" 1294 | }, 1295 | "set-immediate-shim": { 1296 | "version": "1.0.1", 1297 | "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", 1298 | "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" 1299 | }, 1300 | "shot": { 1301 | "version": "3.4.2", 1302 | "resolved": "https://registry.npmjs.org/shot/-/shot-3.4.2.tgz", 1303 | "integrity": "sha1-Hlw/bysmZJrcQvfrNQIUpaApHWc=" 1304 | }, 1305 | "slide": { 1306 | "version": "1.1.6", 1307 | "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", 1308 | "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" 1309 | }, 1310 | "split": { 1311 | "version": "0.3.3", 1312 | "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", 1313 | "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=" 1314 | }, 1315 | "statehood": { 1316 | "version": "5.0.2", 1317 | "resolved": "https://registry.npmjs.org/statehood/-/statehood-5.0.2.tgz", 1318 | "integrity": "sha1-xrO6oW7YsSHT8Jo/+oXiIZWn8qk=" 1319 | }, 1320 | "stream-combiner": { 1321 | "version": "0.0.4", 1322 | "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", 1323 | "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=" 1324 | }, 1325 | "stream-shift": { 1326 | "version": "1.0.0", 1327 | "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", 1328 | "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" 1329 | }, 1330 | "string_decoder": { 1331 | "version": "1.0.2", 1332 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.2.tgz", 1333 | "integrity": "sha1-sp4fThEl+pehA4K4pTNze3SR4Xk=" 1334 | }, 1335 | "string-length": { 1336 | "version": "1.0.1", 1337 | "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", 1338 | "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=" 1339 | }, 1340 | "strip-ansi": { 1341 | "version": "3.0.1", 1342 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1343 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=" 1344 | }, 1345 | "strip-json-comments": { 1346 | "version": "2.0.1", 1347 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1348 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 1349 | }, 1350 | "subtext": { 1351 | "version": "4.4.1", 1352 | "resolved": "https://registry.npmjs.org/subtext/-/subtext-4.4.1.tgz", 1353 | "integrity": "sha1-L87JRd5CkoPD0YsVH/D6HxuHrsk=" 1354 | }, 1355 | "supports-color": { 1356 | "version": "2.0.0", 1357 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 1358 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" 1359 | }, 1360 | "through": { 1361 | "version": "2.3.8", 1362 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1363 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 1364 | }, 1365 | "timed-out": { 1366 | "version": "2.0.0", 1367 | "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", 1368 | "integrity": "sha1-84sK6B03R9YoAB9B2vxlKs5nHAo=" 1369 | }, 1370 | "topo": { 1371 | "version": "2.0.2", 1372 | "resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz", 1373 | "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=" 1374 | }, 1375 | "touch": { 1376 | "version": "1.0.0", 1377 | "resolved": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", 1378 | "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=" 1379 | }, 1380 | "undefsafe": { 1381 | "version": "0.0.3", 1382 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", 1383 | "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=" 1384 | }, 1385 | "update-notifier": { 1386 | "version": "0.5.0", 1387 | "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", 1388 | "integrity": "sha1-B7XcIGazYnqztPUwEw9+3doHpMw=" 1389 | }, 1390 | "util-deprecate": { 1391 | "version": "1.0.2", 1392 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1393 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1394 | }, 1395 | "uuid": { 1396 | "version": "2.0.3", 1397 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", 1398 | "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" 1399 | }, 1400 | "vise": { 1401 | "version": "2.0.2", 1402 | "resolved": "https://registry.npmjs.org/vise/-/vise-2.0.2.tgz", 1403 | "integrity": "sha1-awjo+0y3bjpQzW3Q7DczjoEaDTk=" 1404 | }, 1405 | "wrappy": { 1406 | "version": "1.0.2", 1407 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1408 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1409 | }, 1410 | "wreck": { 1411 | "version": "12.2.2", 1412 | "resolved": "https://registry.npmjs.org/wreck/-/wreck-12.2.2.tgz", 1413 | "integrity": "sha1-4hgj00w21nIATu+jR66MT2BQ49s=" 1414 | }, 1415 | "write-file-atomic": { 1416 | "version": "1.3.4", 1417 | "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", 1418 | "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=" 1419 | }, 1420 | "xdg-basedir": { 1421 | "version": "2.0.0", 1422 | "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", 1423 | "integrity": "sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I=" 1424 | }, 1425 | "yallist": { 1426 | "version": "2.1.2", 1427 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", 1428 | "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" 1429 | } 1430 | } 1431 | } 1432 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "dev": "nodemon src/start.js", 9 | "start": "node src/start" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "hapi": "^16.4.3", 15 | "inert": "^4.2.0", 16 | "nodemon": "^1.11.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | Offline first example 11 | 12 | 13 | 14 | 15 |

0

16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /example/public/script.js: -------------------------------------------------------------------------------- 1 | // ----- Counter stuff 2 | 3 | // Get the buttons and the count display 4 | var incDom = document.querySelector('.increment'); 5 | var decDom = document.querySelector('.decrement'); 6 | var count = document.querySelector('.count'); 7 | 8 | // Increment the counter when there's a click event on the + button 9 | incDom.addEventListener('click', function() { 10 | update(inc(model), count); 11 | }); 12 | 13 | // decrement the counter when there's a click event on the - button 14 | decDom.addEventListener('click', function() { 15 | update(dec(model), count); 16 | }); 17 | 18 | // Initialise the counter 19 | var model = 0; 20 | 21 | // Increment the counter 22 | function inc(model) { 23 | return model + 1; 24 | } 25 | 26 | // Decrement the counter 27 | function dec(model) { 28 | return model - 1; 29 | } 30 | 31 | // Update both the counter and the model 32 | function update(newModel, element) { 33 | model = newModel; 34 | element.textContent = model; 35 | } 36 | 37 | /* istanbul ignore next */ 38 | if (typeof module !== 'undefined' && module.exports) { 39 | module.exports = { 40 | inc: inc, 41 | dec: dec, 42 | update: update, 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /example/public/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: palevioletred; 3 | color: white 4 | } 5 | 6 | .increment, .decrement { 7 | display: inline-block; 8 | width: 2rem; 9 | height: 2rem; 10 | background-color: palevioletred; 11 | border-style: none; 12 | border: solid white; 13 | color: white; 14 | font-size: 1.5rem; 15 | line-height: 1; 16 | font-weight: 600; 17 | } 18 | 19 | .count { 20 | display: inline-block; 21 | width: 2rem; 22 | height: 2rem; 23 | text-align: center; 24 | line-height: 1; 25 | font-size: 1.5rem; 26 | font-weight: 600; 27 | padding: 0; 28 | margin: 0; 29 | } 30 | -------------------------------------------------------------------------------- /example/src/router.js: -------------------------------------------------------------------------------- 1 | const serveHome = { 2 | method: 'GET', 3 | path: '/', 4 | handler: (request, reply) => { 5 | reply.file('./public/index.html'); 6 | }, 7 | }; 8 | 9 | const servePublic = { 10 | method: 'GET', 11 | path: '/{file*}', 12 | handler: { 13 | directory: { 14 | path: './public', 15 | }, 16 | }, 17 | }; 18 | 19 | module.exports = [serveHome, servePublic]; 20 | -------------------------------------------------------------------------------- /example/src/server.js: -------------------------------------------------------------------------------- 1 | const hapi = require('hapi'); 2 | const inert = require('inert'); 3 | const server = new hapi.Server(); 4 | 5 | const router = require('./router'); 6 | 7 | server.connection({ 8 | port: process.env.PORT || 4000, 9 | }); 10 | 11 | server.register([inert], err => { 12 | if (err) throw err; 13 | 14 | server.route(router); 15 | }); 16 | 17 | module.exports = server; 18 | -------------------------------------------------------------------------------- /example/src/start.js: -------------------------------------------------------------------------------- 1 | const server = require('./server'); 2 | 3 | server.start(err => { 4 | if (err) throw err; 5 | 6 | console.log(`Server started on port ${server.info.uri}`); 7 | }); 8 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "learn-offline-first", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "@types/node": { 7 | "version": "6.0.78", 8 | "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.78.tgz", 9 | "integrity": "sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg==", 10 | "dev": true 11 | }, 12 | "abab": { 13 | "version": "1.0.3", 14 | "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", 15 | "integrity": "sha1-uB3l9ydOxOdW15fNg08wNkJyTl0=", 16 | "dev": true 17 | }, 18 | "abbrev": { 19 | "version": "1.0.9", 20 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", 21 | "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", 22 | "dev": true 23 | }, 24 | "acorn": { 25 | "version": "4.0.13", 26 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", 27 | "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", 28 | "dev": true 29 | }, 30 | "acorn-globals": { 31 | "version": "3.1.0", 32 | "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", 33 | "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", 34 | "dev": true 35 | }, 36 | "ajv": { 37 | "version": "4.11.8", 38 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", 39 | "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", 40 | "dev": true 41 | }, 42 | "align-text": { 43 | "version": "0.1.4", 44 | "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", 45 | "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", 46 | "dev": true 47 | }, 48 | "amdefine": { 49 | "version": "1.0.1", 50 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", 51 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", 52 | "dev": true 53 | }, 54 | "ansi-regex": { 55 | "version": "2.1.1", 56 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 57 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 58 | "dev": true 59 | }, 60 | "ansi-styles": { 61 | "version": "2.2.1", 62 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 63 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", 64 | "dev": true 65 | }, 66 | "argparse": { 67 | "version": "1.0.9", 68 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", 69 | "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", 70 | "dev": true 71 | }, 72 | "array-equal": { 73 | "version": "1.0.0", 74 | "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", 75 | "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", 76 | "dev": true 77 | }, 78 | "asn1": { 79 | "version": "0.2.3", 80 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", 81 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", 82 | "dev": true 83 | }, 84 | "assert-plus": { 85 | "version": "0.2.0", 86 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", 87 | "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", 88 | "dev": true 89 | }, 90 | "async": { 91 | "version": "1.5.2", 92 | "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", 93 | "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", 94 | "dev": true 95 | }, 96 | "asynckit": { 97 | "version": "0.4.0", 98 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 99 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", 100 | "dev": true 101 | }, 102 | "aws-sign2": { 103 | "version": "0.6.0", 104 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", 105 | "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", 106 | "dev": true 107 | }, 108 | "aws4": { 109 | "version": "1.6.0", 110 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", 111 | "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", 112 | "dev": true 113 | }, 114 | "balanced-match": { 115 | "version": "1.0.0", 116 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 117 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 118 | "dev": true 119 | }, 120 | "bcrypt-pbkdf": { 121 | "version": "1.0.1", 122 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", 123 | "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", 124 | "dev": true, 125 | "optional": true 126 | }, 127 | "boom": { 128 | "version": "2.10.1", 129 | "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", 130 | "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", 131 | "dev": true 132 | }, 133 | "brace-expansion": { 134 | "version": "1.1.8", 135 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", 136 | "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", 137 | "dev": true 138 | }, 139 | "callsite": { 140 | "version": "1.0.0", 141 | "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", 142 | "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", 143 | "dev": true 144 | }, 145 | "camelcase": { 146 | "version": "1.2.1", 147 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", 148 | "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", 149 | "dev": true, 150 | "optional": true 151 | }, 152 | "caseless": { 153 | "version": "0.12.0", 154 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 155 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", 156 | "dev": true 157 | }, 158 | "center-align": { 159 | "version": "0.1.3", 160 | "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", 161 | "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", 162 | "dev": true, 163 | "optional": true 164 | }, 165 | "chalk": { 166 | "version": "1.1.3", 167 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 168 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 169 | "dev": true 170 | }, 171 | "cliui": { 172 | "version": "2.1.0", 173 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", 174 | "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", 175 | "dev": true, 176 | "optional": true, 177 | "dependencies": { 178 | "wordwrap": { 179 | "version": "0.0.2", 180 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", 181 | "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", 182 | "dev": true, 183 | "optional": true 184 | } 185 | } 186 | }, 187 | "co": { 188 | "version": "4.6.0", 189 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 190 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", 191 | "dev": true 192 | }, 193 | "combined-stream": { 194 | "version": "1.0.5", 195 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", 196 | "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", 197 | "dev": true 198 | }, 199 | "concat-map": { 200 | "version": "0.0.1", 201 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 202 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 203 | "dev": true 204 | }, 205 | "content-type-parser": { 206 | "version": "1.0.1", 207 | "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.1.tgz", 208 | "integrity": "sha1-w+VpiMU8ZRJ/tG1AMqOpACRv3JQ=", 209 | "dev": true 210 | }, 211 | "core-util-is": { 212 | "version": "1.0.2", 213 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 214 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", 215 | "dev": true 216 | }, 217 | "cryptiles": { 218 | "version": "2.0.5", 219 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", 220 | "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", 221 | "dev": true 222 | }, 223 | "cssom": { 224 | "version": "0.3.2", 225 | "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", 226 | "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", 227 | "dev": true 228 | }, 229 | "cssstyle": { 230 | "version": "0.2.37", 231 | "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", 232 | "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", 233 | "dev": true 234 | }, 235 | "dashdash": { 236 | "version": "1.14.1", 237 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 238 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 239 | "dev": true, 240 | "dependencies": { 241 | "assert-plus": { 242 | "version": "1.0.0", 243 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 244 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 245 | "dev": true 246 | } 247 | } 248 | }, 249 | "decache": { 250 | "version": "4.1.0", 251 | "resolved": "https://registry.npmjs.org/decache/-/decache-4.1.0.tgz", 252 | "integrity": "sha1-IDfV7fdW3aIwyFAjZZ58PR1uAQU=", 253 | "dev": true 254 | }, 255 | "decamelize": { 256 | "version": "1.2.0", 257 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 258 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", 259 | "dev": true, 260 | "optional": true 261 | }, 262 | "deep-equal": { 263 | "version": "1.0.1", 264 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", 265 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", 266 | "dev": true 267 | }, 268 | "deep-is": { 269 | "version": "0.1.3", 270 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 271 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 272 | "dev": true 273 | }, 274 | "define-properties": { 275 | "version": "1.1.2", 276 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", 277 | "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", 278 | "dev": true 279 | }, 280 | "defined": { 281 | "version": "1.0.0", 282 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", 283 | "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", 284 | "dev": true 285 | }, 286 | "delayed-stream": { 287 | "version": "1.0.0", 288 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 289 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", 290 | "dev": true 291 | }, 292 | "duplexer": { 293 | "version": "0.1.1", 294 | "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", 295 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", 296 | "dev": true 297 | }, 298 | "ecc-jsbn": { 299 | "version": "0.1.1", 300 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", 301 | "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", 302 | "dev": true, 303 | "optional": true 304 | }, 305 | "es-abstract": { 306 | "version": "1.7.0", 307 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz", 308 | "integrity": "sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw=", 309 | "dev": true 310 | }, 311 | "es-to-primitive": { 312 | "version": "1.1.1", 313 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", 314 | "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", 315 | "dev": true 316 | }, 317 | "escape-string-regexp": { 318 | "version": "1.0.5", 319 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 320 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 321 | "dev": true 322 | }, 323 | "escodegen": { 324 | "version": "1.8.1", 325 | "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", 326 | "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", 327 | "dev": true 328 | }, 329 | "esprima": { 330 | "version": "2.7.3", 331 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", 332 | "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", 333 | "dev": true 334 | }, 335 | "estraverse": { 336 | "version": "1.9.3", 337 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", 338 | "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", 339 | "dev": true 340 | }, 341 | "esutils": { 342 | "version": "2.0.2", 343 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 344 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 345 | "dev": true 346 | }, 347 | "extend": { 348 | "version": "3.0.1", 349 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", 350 | "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", 351 | "dev": true 352 | }, 353 | "extsprintf": { 354 | "version": "1.0.2", 355 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", 356 | "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", 357 | "dev": true 358 | }, 359 | "fast-levenshtein": { 360 | "version": "2.0.6", 361 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 362 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 363 | "dev": true 364 | }, 365 | "figures": { 366 | "version": "1.7.0", 367 | "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", 368 | "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", 369 | "dev": true 370 | }, 371 | "for-each": { 372 | "version": "0.3.2", 373 | "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", 374 | "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", 375 | "dev": true 376 | }, 377 | "foreach": { 378 | "version": "2.0.5", 379 | "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", 380 | "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", 381 | "dev": true 382 | }, 383 | "forever-agent": { 384 | "version": "0.6.1", 385 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 386 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", 387 | "dev": true 388 | }, 389 | "form-data": { 390 | "version": "2.1.4", 391 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", 392 | "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", 393 | "dev": true 394 | }, 395 | "fs.realpath": { 396 | "version": "1.0.0", 397 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 398 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 399 | "dev": true 400 | }, 401 | "function-bind": { 402 | "version": "1.1.0", 403 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", 404 | "integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", 405 | "dev": true 406 | }, 407 | "getpass": { 408 | "version": "0.1.7", 409 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 410 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 411 | "dev": true, 412 | "dependencies": { 413 | "assert-plus": { 414 | "version": "1.0.0", 415 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 416 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 417 | "dev": true 418 | } 419 | } 420 | }, 421 | "glob": { 422 | "version": "7.1.2", 423 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", 424 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", 425 | "dev": true 426 | }, 427 | "graceful-fs": { 428 | "version": "4.1.11", 429 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", 430 | "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", 431 | "dev": true 432 | }, 433 | "handlebars": { 434 | "version": "4.0.10", 435 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.10.tgz", 436 | "integrity": "sha1-PTDHGLCaPZbyPqTMH0A8TTup/08=", 437 | "dev": true, 438 | "dependencies": { 439 | "source-map": { 440 | "version": "0.4.4", 441 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", 442 | "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", 443 | "dev": true 444 | } 445 | } 446 | }, 447 | "har-schema": { 448 | "version": "1.0.5", 449 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", 450 | "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", 451 | "dev": true 452 | }, 453 | "har-validator": { 454 | "version": "4.2.1", 455 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", 456 | "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", 457 | "dev": true 458 | }, 459 | "has": { 460 | "version": "1.0.1", 461 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", 462 | "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", 463 | "dev": true 464 | }, 465 | "has-ansi": { 466 | "version": "2.0.0", 467 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 468 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 469 | "dev": true 470 | }, 471 | "has-flag": { 472 | "version": "1.0.0", 473 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", 474 | "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", 475 | "dev": true 476 | }, 477 | "hawk": { 478 | "version": "3.1.3", 479 | "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", 480 | "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", 481 | "dev": true 482 | }, 483 | "hoek": { 484 | "version": "2.16.3", 485 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", 486 | "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", 487 | "dev": true 488 | }, 489 | "html-encoding-sniffer": { 490 | "version": "1.0.1", 491 | "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz", 492 | "integrity": "sha1-eb96eF6klf5mFl5zQVPzY/9UN9o=", 493 | "dev": true 494 | }, 495 | "http-signature": { 496 | "version": "1.1.1", 497 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", 498 | "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", 499 | "dev": true 500 | }, 501 | "iconv-lite": { 502 | "version": "0.4.13", 503 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", 504 | "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", 505 | "dev": true 506 | }, 507 | "imurmurhash": { 508 | "version": "0.1.4", 509 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 510 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", 511 | "dev": true 512 | }, 513 | "inflight": { 514 | "version": "1.0.6", 515 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 516 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 517 | "dev": true 518 | }, 519 | "inherits": { 520 | "version": "2.0.3", 521 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 522 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 523 | "dev": true 524 | }, 525 | "is-buffer": { 526 | "version": "1.1.5", 527 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", 528 | "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", 529 | "dev": true 530 | }, 531 | "is-callable": { 532 | "version": "1.1.3", 533 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", 534 | "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", 535 | "dev": true 536 | }, 537 | "is-date-object": { 538 | "version": "1.0.1", 539 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", 540 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", 541 | "dev": true 542 | }, 543 | "is-finite": { 544 | "version": "1.0.2", 545 | "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", 546 | "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", 547 | "dev": true 548 | }, 549 | "is-function": { 550 | "version": "1.0.1", 551 | "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", 552 | "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", 553 | "dev": true 554 | }, 555 | "is-regex": { 556 | "version": "1.0.4", 557 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", 558 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", 559 | "dev": true 560 | }, 561 | "is-symbol": { 562 | "version": "1.0.1", 563 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", 564 | "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", 565 | "dev": true 566 | }, 567 | "is-typedarray": { 568 | "version": "1.0.0", 569 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 570 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", 571 | "dev": true 572 | }, 573 | "isarray": { 574 | "version": "1.0.0", 575 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 576 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 577 | "dev": true 578 | }, 579 | "isexe": { 580 | "version": "2.0.0", 581 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 582 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 583 | "dev": true 584 | }, 585 | "isstream": { 586 | "version": "0.1.2", 587 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 588 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", 589 | "dev": true 590 | }, 591 | "istanbul": { 592 | "version": "0.4.5", 593 | "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", 594 | "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", 595 | "dev": true, 596 | "dependencies": { 597 | "glob": { 598 | "version": "5.0.15", 599 | "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", 600 | "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", 601 | "dev": true 602 | }, 603 | "supports-color": { 604 | "version": "3.2.3", 605 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", 606 | "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", 607 | "dev": true 608 | } 609 | } 610 | }, 611 | "js-yaml": { 612 | "version": "3.8.4", 613 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.4.tgz", 614 | "integrity": "sha1-UgtFZPhlc7qWZir4Woyvp7S1pvY=", 615 | "dev": true, 616 | "dependencies": { 617 | "esprima": { 618 | "version": "3.1.3", 619 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", 620 | "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", 621 | "dev": true 622 | } 623 | } 624 | }, 625 | "jsbn": { 626 | "version": "0.1.1", 627 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 628 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", 629 | "dev": true, 630 | "optional": true 631 | }, 632 | "jsdom": { 633 | "version": "11.0.0", 634 | "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.0.0.tgz", 635 | "integrity": "sha1-HuUHyywLFsh1ACR2sahVfZUTU+U=", 636 | "dev": true 637 | }, 638 | "json-schema": { 639 | "version": "0.2.3", 640 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 641 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", 642 | "dev": true 643 | }, 644 | "json-stable-stringify": { 645 | "version": "1.0.1", 646 | "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", 647 | "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", 648 | "dev": true 649 | }, 650 | "json-stringify-safe": { 651 | "version": "5.0.1", 652 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 653 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", 654 | "dev": true 655 | }, 656 | "jsonify": { 657 | "version": "0.0.0", 658 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", 659 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", 660 | "dev": true 661 | }, 662 | "jsprim": { 663 | "version": "1.4.0", 664 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", 665 | "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", 666 | "dev": true, 667 | "dependencies": { 668 | "assert-plus": { 669 | "version": "1.0.0", 670 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 671 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 672 | "dev": true 673 | } 674 | } 675 | }, 676 | "kind-of": { 677 | "version": "3.2.2", 678 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 679 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 680 | "dev": true 681 | }, 682 | "lazy-cache": { 683 | "version": "1.0.4", 684 | "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", 685 | "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", 686 | "dev": true, 687 | "optional": true 688 | }, 689 | "levn": { 690 | "version": "0.3.0", 691 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 692 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 693 | "dev": true 694 | }, 695 | "lodash": { 696 | "version": "3.10.1", 697 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", 698 | "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", 699 | "dev": true 700 | }, 701 | "longest": { 702 | "version": "1.0.1", 703 | "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", 704 | "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", 705 | "dev": true 706 | }, 707 | "mime-db": { 708 | "version": "1.27.0", 709 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", 710 | "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", 711 | "dev": true 712 | }, 713 | "mime-types": { 714 | "version": "2.1.15", 715 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", 716 | "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", 717 | "dev": true 718 | }, 719 | "minimatch": { 720 | "version": "3.0.4", 721 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 722 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 723 | "dev": true 724 | }, 725 | "minimist": { 726 | "version": "1.2.0", 727 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 728 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", 729 | "dev": true 730 | }, 731 | "mkdirp": { 732 | "version": "0.5.1", 733 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 734 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 735 | "dev": true, 736 | "dependencies": { 737 | "minimist": { 738 | "version": "0.0.8", 739 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 740 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 741 | "dev": true 742 | } 743 | } 744 | }, 745 | "node-localstorage": { 746 | "version": "1.3.0", 747 | "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-1.3.0.tgz", 748 | "integrity": "sha1-LkNqro3Mms6XtDxlwWwNV3vgpVw=", 749 | "dev": true 750 | }, 751 | "nopt": { 752 | "version": "3.0.6", 753 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", 754 | "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", 755 | "dev": true 756 | }, 757 | "number-is-nan": { 758 | "version": "1.0.1", 759 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 760 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", 761 | "dev": true 762 | }, 763 | "nwmatcher": { 764 | "version": "1.4.1", 765 | "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.1.tgz", 766 | "integrity": "sha1-eumwew6oBNt+JfBctf5Al9TklJ8=", 767 | "dev": true 768 | }, 769 | "oauth-sign": { 770 | "version": "0.8.2", 771 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", 772 | "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", 773 | "dev": true 774 | }, 775 | "object-assign": { 776 | "version": "4.1.1", 777 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 778 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 779 | "dev": true 780 | }, 781 | "object-inspect": { 782 | "version": "1.2.2", 783 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.2.2.tgz", 784 | "integrity": "sha1-yCEV5PzIiK6hTWTCLk8X9qcNXlo=", 785 | "dev": true 786 | }, 787 | "object-keys": { 788 | "version": "1.0.11", 789 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", 790 | "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", 791 | "dev": true 792 | }, 793 | "once": { 794 | "version": "1.4.0", 795 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 796 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 797 | "dev": true 798 | }, 799 | "optimist": { 800 | "version": "0.6.1", 801 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", 802 | "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", 803 | "dev": true, 804 | "dependencies": { 805 | "minimist": { 806 | "version": "0.0.10", 807 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", 808 | "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", 809 | "dev": true 810 | }, 811 | "wordwrap": { 812 | "version": "0.0.3", 813 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", 814 | "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", 815 | "dev": true 816 | } 817 | } 818 | }, 819 | "optionator": { 820 | "version": "0.8.2", 821 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 822 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 823 | "dev": true 824 | }, 825 | "parse-ms": { 826 | "version": "1.0.1", 827 | "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", 828 | "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", 829 | "dev": true 830 | }, 831 | "parse5": { 832 | "version": "3.0.2", 833 | "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.2.tgz", 834 | "integrity": "sha1-Be/1fw70V3+xRKefi5qWemzERRA=", 835 | "dev": true 836 | }, 837 | "path-is-absolute": { 838 | "version": "1.0.1", 839 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 840 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 841 | "dev": true 842 | }, 843 | "performance-now": { 844 | "version": "0.2.0", 845 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", 846 | "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", 847 | "dev": true 848 | }, 849 | "plur": { 850 | "version": "1.0.0", 851 | "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", 852 | "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", 853 | "dev": true 854 | }, 855 | "pn": { 856 | "version": "1.0.0", 857 | "resolved": "https://registry.npmjs.org/pn/-/pn-1.0.0.tgz", 858 | "integrity": "sha1-HPWjCw2AbNGPiPxBprXUrWFbO6k=", 859 | "dev": true 860 | }, 861 | "prelude-ls": { 862 | "version": "1.1.2", 863 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 864 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 865 | "dev": true 866 | }, 867 | "pretty-ms": { 868 | "version": "2.1.0", 869 | "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", 870 | "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", 871 | "dev": true 872 | }, 873 | "process-nextick-args": { 874 | "version": "1.0.7", 875 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", 876 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", 877 | "dev": true 878 | }, 879 | "punycode": { 880 | "version": "1.4.1", 881 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 882 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", 883 | "dev": true 884 | }, 885 | "qs": { 886 | "version": "6.4.0", 887 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", 888 | "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", 889 | "dev": true 890 | }, 891 | "re-emitter": { 892 | "version": "1.1.3", 893 | "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", 894 | "integrity": "sha1-+p4xn/3u6zWycpbvDz03TawvUqc=", 895 | "dev": true 896 | }, 897 | "readable-stream": { 898 | "version": "2.3.0", 899 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.0.tgz", 900 | "integrity": "sha512-c7KMXGd4b48nN3OJ1U9qOsn6pXNzf6kLd3kdZCkg2sxAcoiufInqF0XckwEnlrcwuaYwonlNK8GQUIOC/WC7sg==", 901 | "dev": true 902 | }, 903 | "repeat-string": { 904 | "version": "1.6.1", 905 | "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", 906 | "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", 907 | "dev": true 908 | }, 909 | "request": { 910 | "version": "2.81.0", 911 | "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", 912 | "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", 913 | "dev": true 914 | }, 915 | "request-promise-core": { 916 | "version": "1.1.1", 917 | "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", 918 | "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", 919 | "dev": true, 920 | "dependencies": { 921 | "lodash": { 922 | "version": "4.17.4", 923 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", 924 | "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", 925 | "dev": true 926 | } 927 | } 928 | }, 929 | "request-promise-native": { 930 | "version": "1.0.4", 931 | "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.4.tgz", 932 | "integrity": "sha1-hpiOyO7kCORVefzoO/0Fs635oVU=", 933 | "dev": true 934 | }, 935 | "resolve": { 936 | "version": "1.1.7", 937 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", 938 | "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", 939 | "dev": true 940 | }, 941 | "resumer": { 942 | "version": "0.0.0", 943 | "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", 944 | "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", 945 | "dev": true 946 | }, 947 | "right-align": { 948 | "version": "0.1.3", 949 | "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", 950 | "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", 951 | "dev": true, 952 | "optional": true 953 | }, 954 | "safe-buffer": { 955 | "version": "5.1.0", 956 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.0.tgz", 957 | "integrity": "sha512-aSLEDudu6OoRr/2rU609gRmnYboRLxgDG1z9o2Q0os7236FwvcqIOO8r8U5JUEwivZOhDaKlFO4SbPTJYyBEyQ==", 958 | "dev": true 959 | }, 960 | "sax": { 961 | "version": "1.2.2", 962 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.2.tgz", 963 | "integrity": "sha1-/YYxojvHgmvvXYcb24c3jJVkeCg=", 964 | "dev": true 965 | }, 966 | "slide": { 967 | "version": "1.1.6", 968 | "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", 969 | "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", 970 | "dev": true 971 | }, 972 | "sntp": { 973 | "version": "1.0.9", 974 | "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", 975 | "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", 976 | "dev": true 977 | }, 978 | "source-map": { 979 | "version": "0.2.0", 980 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", 981 | "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", 982 | "dev": true, 983 | "optional": true 984 | }, 985 | "split": { 986 | "version": "1.0.0", 987 | "resolved": "https://registry.npmjs.org/split/-/split-1.0.0.tgz", 988 | "integrity": "sha1-xDlc5oOrzSVLwo/h2rtuXCfc/64=", 989 | "dev": true 990 | }, 991 | "sprintf-js": { 992 | "version": "1.0.3", 993 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 994 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 995 | "dev": true 996 | }, 997 | "sshpk": { 998 | "version": "1.13.1", 999 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", 1000 | "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", 1001 | "dev": true, 1002 | "dependencies": { 1003 | "assert-plus": { 1004 | "version": "1.0.0", 1005 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 1006 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", 1007 | "dev": true 1008 | } 1009 | } 1010 | }, 1011 | "stealthy-require": { 1012 | "version": "1.1.1", 1013 | "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", 1014 | "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", 1015 | "dev": true 1016 | }, 1017 | "string_decoder": { 1018 | "version": "1.0.2", 1019 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.2.tgz", 1020 | "integrity": "sha1-sp4fThEl+pehA4K4pTNze3SR4Xk=", 1021 | "dev": true, 1022 | "dependencies": { 1023 | "safe-buffer": { 1024 | "version": "5.0.1", 1025 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", 1026 | "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", 1027 | "dev": true 1028 | } 1029 | } 1030 | }, 1031 | "string.prototype.trim": { 1032 | "version": "1.1.2", 1033 | "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", 1034 | "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", 1035 | "dev": true 1036 | }, 1037 | "stringstream": { 1038 | "version": "0.0.5", 1039 | "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", 1040 | "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", 1041 | "dev": true 1042 | }, 1043 | "strip-ansi": { 1044 | "version": "3.0.1", 1045 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1046 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1047 | "dev": true 1048 | }, 1049 | "supports-color": { 1050 | "version": "2.0.0", 1051 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 1052 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", 1053 | "dev": true 1054 | }, 1055 | "symbol-tree": { 1056 | "version": "3.2.2", 1057 | "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", 1058 | "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", 1059 | "dev": true 1060 | }, 1061 | "tap-out": { 1062 | "version": "1.4.2", 1063 | "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-1.4.2.tgz", 1064 | "integrity": "sha1-yQfsG/lAURHQiCY+kvVgi4jLs3o=", 1065 | "dev": true 1066 | }, 1067 | "tap-spec": { 1068 | "version": "4.1.1", 1069 | "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-4.1.1.tgz", 1070 | "integrity": "sha1-4unyb1IIIysfViKIyXYk1YqI8Fo=", 1071 | "dev": true 1072 | }, 1073 | "tape": { 1074 | "version": "4.6.3", 1075 | "resolved": "https://registry.npmjs.org/tape/-/tape-4.6.3.tgz", 1076 | "integrity": "sha1-Y353WB6ass4XV36b1M5PV1gG2LY=", 1077 | "dev": true 1078 | }, 1079 | "through": { 1080 | "version": "2.3.8", 1081 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1082 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", 1083 | "dev": true 1084 | }, 1085 | "through2": { 1086 | "version": "2.0.3", 1087 | "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", 1088 | "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", 1089 | "dev": true 1090 | }, 1091 | "tough-cookie": { 1092 | "version": "2.3.2", 1093 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", 1094 | "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", 1095 | "dev": true 1096 | }, 1097 | "tr46": { 1098 | "version": "0.0.3", 1099 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 1100 | "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", 1101 | "dev": true 1102 | }, 1103 | "trim": { 1104 | "version": "0.0.1", 1105 | "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", 1106 | "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", 1107 | "dev": true 1108 | }, 1109 | "tunnel-agent": { 1110 | "version": "0.6.0", 1111 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 1112 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 1113 | "dev": true 1114 | }, 1115 | "tweetnacl": { 1116 | "version": "0.14.5", 1117 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 1118 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", 1119 | "dev": true, 1120 | "optional": true 1121 | }, 1122 | "type-check": { 1123 | "version": "0.3.2", 1124 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 1125 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 1126 | "dev": true 1127 | }, 1128 | "uglify-js": { 1129 | "version": "2.8.29", 1130 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", 1131 | "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", 1132 | "dev": true, 1133 | "optional": true, 1134 | "dependencies": { 1135 | "source-map": { 1136 | "version": "0.5.6", 1137 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", 1138 | "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", 1139 | "dev": true, 1140 | "optional": true 1141 | } 1142 | } 1143 | }, 1144 | "uglify-to-browserify": { 1145 | "version": "1.0.2", 1146 | "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", 1147 | "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", 1148 | "dev": true, 1149 | "optional": true 1150 | }, 1151 | "util-deprecate": { 1152 | "version": "1.0.2", 1153 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1154 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", 1155 | "dev": true 1156 | }, 1157 | "uuid": { 1158 | "version": "3.1.0", 1159 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", 1160 | "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", 1161 | "dev": true 1162 | }, 1163 | "verror": { 1164 | "version": "1.3.6", 1165 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", 1166 | "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", 1167 | "dev": true 1168 | }, 1169 | "webidl-conversions": { 1170 | "version": "4.0.1", 1171 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.1.tgz", 1172 | "integrity": "sha1-gBWherg+fhsxFjhIas6B2mziBqA=", 1173 | "dev": true 1174 | }, 1175 | "whatwg-encoding": { 1176 | "version": "1.0.1", 1177 | "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz", 1178 | "integrity": "sha1-PGxFGhmO567FWx7GHQkgxngBpfQ=", 1179 | "dev": true 1180 | }, 1181 | "whatwg-url": { 1182 | "version": "4.8.0", 1183 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-4.8.0.tgz", 1184 | "integrity": "sha1-0pgaqRSMHgCkHFphMRZqtGg7vMA=", 1185 | "dev": true, 1186 | "dependencies": { 1187 | "webidl-conversions": { 1188 | "version": "3.0.1", 1189 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 1190 | "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", 1191 | "dev": true 1192 | } 1193 | } 1194 | }, 1195 | "which": { 1196 | "version": "1.2.14", 1197 | "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", 1198 | "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", 1199 | "dev": true 1200 | }, 1201 | "window-size": { 1202 | "version": "0.1.0", 1203 | "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", 1204 | "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", 1205 | "dev": true, 1206 | "optional": true 1207 | }, 1208 | "wordwrap": { 1209 | "version": "1.0.0", 1210 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1211 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 1212 | "dev": true 1213 | }, 1214 | "wrappy": { 1215 | "version": "1.0.2", 1216 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1217 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1218 | "dev": true 1219 | }, 1220 | "write-file-atomic": { 1221 | "version": "1.3.4", 1222 | "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", 1223 | "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", 1224 | "dev": true 1225 | }, 1226 | "xml-name-validator": { 1227 | "version": "2.0.1", 1228 | "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", 1229 | "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", 1230 | "dev": true 1231 | }, 1232 | "xtend": { 1233 | "version": "4.0.1", 1234 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 1235 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", 1236 | "dev": true 1237 | }, 1238 | "yargs": { 1239 | "version": "3.10.0", 1240 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", 1241 | "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", 1242 | "dev": true, 1243 | "optional": true 1244 | } 1245 | } 1246 | } 1247 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "learn-offline-first", 3 | "version": "1.0.0", 4 | "description": "Learn how to build web apps that can be used offline", 5 | "main": "index.js", 6 | "directories": { 7 | "example": "example" 8 | }, 9 | "scripts": { 10 | "test": "tape test/*.js | tap-spec", 11 | "coverage": "istanbul cover tape -- test/*.js | tap-spec" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/dwyl/learn-offline-first.git" 16 | }, 17 | "author": "@dwyl & friends!", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/dwyl/learn-offline-first/issues" 21 | }, 22 | "homepage": "https://github.com/dwyl/learn-offline-first#readme", 23 | "devDependencies": { 24 | "decache": "^4.1.0", 25 | "istanbul": "^0.4.5", 26 | "jsdom": "^11.0.0", 27 | "node-localstorage": "^1.3.0", 28 | "tap-spec": "^4.1.1", 29 | "tape": "^4.6.3" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/example.spec.js: -------------------------------------------------------------------------------- 1 | const test = require('tape'); 2 | const fs = require('fs'); 3 | const { JSDOM } = require('jsdom'); 4 | 5 | const html = fs.readFileSync( 6 | __dirname + '/../example/public/index.html', 7 | 'utf8' 8 | ); 9 | const DOM = new JSDOM(html); 10 | global.document = DOM.window.document; 11 | 12 | const { inc, dec, update } = require('./../example/public/script'); 13 | 14 | const count = document.querySelector('.count'); 15 | 16 | test('tests dec decrements and inc increments', t => { 17 | global.document = DOM.window.document; 18 | let result = dec(1); 19 | let expected = 0; 20 | t.equal(result, expected, 'dec(1) returns 0'); 21 | 22 | result = inc(0); 23 | expected = 1; 24 | t.equal(result, expected, 'inc(0) returns 1'); 25 | t.end(); 26 | }); 27 | 28 | test('update updates an element', t => { 29 | update(5, count); 30 | let result = count.textContent; 31 | let expected = '5'; 32 | t.equal(result, expected, 'update with 5 updates element to 5'); 33 | update(0, count); 34 | result = count.textContent; 35 | expected = '0'; 36 | t.equal(result, expected, 'update with 0 updates element to 0'); 37 | t.end(); 38 | }); 39 | 40 | test('Tests that clicking the - decrements the count', t => { 41 | update(0, count); 42 | 43 | let result = count.textContent; 44 | let expected = '0'; 45 | t.equal(result, expected, 'initial count is 0'); 46 | 47 | document.querySelector('.decrement').click(); 48 | result = count.textContent; 49 | expected = '-1'; 50 | t.equal(result, expected, 'count after click is -1'); 51 | t.end(); 52 | }); 53 | 54 | test('Tests that clicking the + increments the count', t => { 55 | update(0, count); // reset count to 0 56 | 57 | let result = count.textContent; 58 | let expected = '0'; 59 | t.equal(result, expected, 'initial count is 0'); 60 | 61 | document.querySelector('.increment').click(); 62 | result = count.textContent; 63 | expected = '1'; 64 | t.equal(result, expected, 'Count after click is 1'); 65 | t.end(); 66 | }); 67 | 68 | test('Reset the global document to null', t => { 69 | document = null; 70 | t.pass('Reset'); 71 | t.end(); 72 | }); 73 | -------------------------------------------------------------------------------- /test/exampleComplete.spec.js: -------------------------------------------------------------------------------- 1 | const test = require('tape'); 2 | const fs = require('fs'); 3 | const { JSDOM } = require('jsdom'); 4 | const ls = require('node-localstorage').LocalStorage; 5 | const decache = require('decache'); 6 | 7 | const html = fs.readFileSync( 8 | __dirname + '/../example-complete/public/index.html', 9 | 'utf8' 10 | ); 11 | const DOM = new JSDOM(html); 12 | 13 | // Add localStorage to JSDOM 14 | const localStorage = new ls('./scratch'); 15 | DOM.window.localStorage = localStorage; 16 | 17 | // Initialise fake application cache 18 | const updateCache = _ => 1; 19 | const swapCache = _ => 1; 20 | DOM.window.applicationCache = { 21 | status: 'idle', 22 | IDLE: 'idle', 23 | UPDATEREADY: 'updateready', 24 | update: updateCache, 25 | swapCache: swapCache, 26 | addEventListener: DOM.window.addEventListener, 27 | }; 28 | 29 | document = DOM.window.document; 30 | window = DOM.window; 31 | global.navigator = { onLine: true }; 32 | 33 | let { inc, dec, update } = require('./../example-complete/public/script'); 34 | 35 | const count = document.querySelector('.count'); 36 | 37 | test("If there's no initial state the count starts at 0", t => { 38 | document = DOM.window.document; // reset global document for this set of tests 39 | 40 | let result = count.textContent; 41 | let expected = '0'; 42 | t.equal(result, expected, 'With no localStorage the count is 0'); 43 | t.end(); 44 | }); 45 | 46 | test('If there is localStorage count is set by it', t => { 47 | const newDOM = new JSDOM(html); // resets dom 48 | document = newDOM.window.document; // reset global document 49 | const appcache = window.applicationCache; 50 | window = newDOM.window; 51 | window.localStorage = localStorage; 52 | window.applicationCache = appcache; 53 | 54 | // decache the script to test if it re-initialises with localStorage 55 | decache('./../example-complete/public/script'); 56 | localStorage.setItem('model', '5'); // set the localStorage to 5 57 | 58 | // re-require the script 59 | let { inc, dec, update } = require('./../example-complete/public/script'); 60 | 61 | const count = document.querySelector('.count'); 62 | 63 | let result = count.textContent; 64 | let expected = '5'; 65 | t.equal(result, expected, 'With localStorage model of 5 count is 5'); 66 | t.end(); 67 | }); 68 | 69 | test('tests dec decrements and inc increments', t => { 70 | let result = dec(1); 71 | let expected = 0; 72 | t.equal(result, expected, 'dec(1) returns 0'); 73 | 74 | result = inc(0); 75 | expected = 1; 76 | t.equal(result, expected, 'inc(0) returns 1'); 77 | t.end(); 78 | }); 79 | 80 | test('update updates an element', t => { 81 | document = DOM.window.document; // reset global document 82 | update(5, count); 83 | let result = count.textContent; 84 | let expected = '5'; 85 | t.equal(result, expected, 'update with 5 updates element to 5'); 86 | 87 | update(0, count); 88 | result = count.textContent; 89 | expected = '0'; 90 | t.equal(result, expected, 'update with 0 updates element to 0'); 91 | t.end(); 92 | }); 93 | 94 | test('Tests that clicking the - decrements the count', t => { 95 | update(0, count); // reset count to 0 96 | let result = count.textContent; 97 | let expected = '0'; 98 | t.equal(result, expected, 'initial count is 0'); 99 | 100 | document.querySelector('.decrement').click(); 101 | result = count.textContent; 102 | expected = '-1'; 103 | t.equal(result, expected, 'count after click is -1'); 104 | t.end(); 105 | }); 106 | 107 | test('Tests that clicking the + increments the count', t => { 108 | update(0, count); // reset count to 0 109 | 110 | let result = count.textContent; 111 | let expected = '0'; 112 | t.equal(result, expected, 'initial count is 0'); 113 | 114 | document.querySelector('.increment').click(); 115 | result = count.textContent; 116 | expected = '1'; 117 | t.equal(result, expected, 'Count after click is 1'); 118 | t.end(); 119 | }); 120 | 121 | test('Update also updates localStorage', t => { 122 | let result = localStorage.getItem('model'); 123 | let expected = '1'; 124 | t.equal(result, expected, 'localstorage model is initially 1'); 125 | 126 | update(5, count); 127 | result = localStorage.getItem('model'); 128 | expected = '5'; 129 | t.equal(result, expected, 'after update localstorage model is 5'); 130 | t.end(); 131 | }); 132 | 133 | test('Testing online-status/navigator.onLine', t => { 134 | let result = document.querySelector('.online-status').textContent; 135 | let expected = 'online'; 136 | t.equal( 137 | result, 138 | expected, 139 | 'online-status is "online" when navigator.onLine is true' 140 | ); 141 | 142 | decache('./../example-complete/public/script'); 143 | global.navigator = { onLine: false }; 144 | let { inc, dec, update } = require('./../example-complete/public/script'); 145 | result = document.querySelector('.online-status').textContent; 146 | expected = 'offline'; 147 | t.equal( 148 | result, 149 | expected, 150 | 'online-status is "offline" when navigator.onLine is false' 151 | ); 152 | t.end(); 153 | }); 154 | 155 | test('Testing online/offline events effecting online-status', t => { 156 | const goOnline = new window.Event('online'); 157 | window.dispatchEvent(goOnline); 158 | let result = document.querySelector('.online-status').textContent; 159 | let expected = 'online'; 160 | t.equal( 161 | result, 162 | expected, 163 | 'online-status is "online" after online event fired' 164 | ); 165 | 166 | const goOffline = new window.Event('offline'); 167 | window.dispatchEvent(goOffline); 168 | result = document.querySelector('.online-status').textContent; 169 | expected = 'offline'; 170 | t.equal( 171 | result, 172 | expected, 173 | 'online-status is "offline" after offline event fired' 174 | ); 175 | t.end(); 176 | }); 177 | 178 | test('Test the app runs an update on start if appcache.status is idle', t => { 179 | const newDOM = new JSDOM(html); // resets dom 180 | document = newDOM.window.document; // reset global document 181 | window = newDOM.window; 182 | window.localStorage = localStorage; 183 | 184 | let updateRun = false; 185 | let swapRun = false; 186 | const updateCache = _ => { 187 | updateRun = true; 188 | }; 189 | const swapCache = _ => { 190 | swapRun = true; 191 | }; 192 | 193 | newDOM.window.applicationCache = { 194 | status: '1', 195 | IDLE: '1', 196 | UPDATEREADY: '4', 197 | update: updateCache, 198 | swapCache: swapCache, 199 | addEventListener: DOM.window.addEventListener, 200 | }; 201 | 202 | // decache the script to test if it re-initialises with localStorage 203 | decache('./../example-complete/public/script'); 204 | // re-require the script 205 | let { inc, dec, update } = require('./../example-complete/public/script'); 206 | 207 | t.ok(updateRun, 'When appcache status equals idle update is run'); 208 | t.ok(!swapRun, 'When appcache status equals idle swap is not run'); 209 | 210 | t.end(); 211 | }); 212 | 213 | test('Test the app runs swap on start if appcache.status is UPDATEREADY', t => { 214 | const newDOM = new JSDOM(html); // resets dom 215 | document = newDOM.window.document; // reset global document 216 | window = newDOM.window; 217 | window.localStorage = localStorage; 218 | 219 | let updateRun = false; 220 | let swapRun = false; 221 | const updateCache = () => { 222 | updateRun = true; 223 | }; 224 | const swapCache = () => { 225 | swapRun = true; 226 | }; 227 | 228 | newDOM.window.applicationCache = { 229 | status: '4', 230 | IDLE: '1', 231 | UPDATEREADY: '4', 232 | update: updateCache, 233 | swapCache: swapCache, 234 | addEventListener: DOM.window.addEventListener, 235 | }; 236 | 237 | // decache the script to test if it re-initialises with localStorage 238 | decache('./../example-complete/public/script'); 239 | // re-require the script 240 | let { inc, dec, update } = require('./../example-complete/public/script'); 241 | 242 | t.ok(!updateRun, 'When appcache status equals updateready update is not run'); 243 | t.ok(swapRun, 'When appcache status equals updateready swap is run'); 244 | 245 | t.end(); 246 | }); 247 | 248 | test('Test event listener for updateready', t => { 249 | const newDOM = new JSDOM(html); // resets dom 250 | document = newDOM.window.document; // reset global document 251 | window = newDOM.window; 252 | window.localStorage = localStorage; 253 | 254 | let updateRun = false; 255 | let swapRun = false; 256 | const updateCache = () => { 257 | updateRun = true; 258 | }; 259 | const swapCache = () => { 260 | swapRun = true; 261 | }; 262 | let reloadRun = false; 263 | newDOM.window.location.reload = () => { 264 | reloadRun = true; 265 | }; 266 | 267 | window.applicationCache = { 268 | status: '4', 269 | IDLE: '1', 270 | UPDATEREADY: '4', 271 | update: updateCache, 272 | swapCache: swapCache, 273 | addEventListener: window.addEventListener, 274 | Event: window.Event, 275 | dispatchEvent: window.dispatchEvent, 276 | }; 277 | 278 | // decache the script to test if it re-initialises with localStorage 279 | decache('./../example-complete/public/script'); 280 | // re-require the script 281 | let { inc, dec, update } = require('./../example-complete/public/script'); 282 | 283 | t.ok(!reloadRun, 'reloadRun should not be true before event triggered'); 284 | 285 | const updateReadyEvent = new window.applicationCache.Event('updateready'); 286 | 287 | window.applicationCache.dispatchEvent(updateReadyEvent); 288 | 289 | t.ok(reloadRun, 'reloadRun should be true once event has been triggered'); 290 | t.end(); 291 | }); 292 | 293 | test('Reset the globals and remove model from localStorage scratch', t => { 294 | document = null; 295 | window = null; 296 | navigator = null; 297 | t.pass('reset document, window and navigator'); 298 | fs.unlinkSync(__dirname + '/../scratch/model'); 299 | fs.rmdirSync(__dirname + '/../scratch'); 300 | t.pass('localStorage scratch removed with model'); 301 | t.end(); 302 | }); 303 | --------------------------------------------------------------------------------