├── .editorconfig ├── .eslintrc ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .travis.yml ├── LICENSE ├── README.md ├── lib └── index.js ├── package-lock.json ├── package.json └── test ├── fixtures ├── basic │ ├── expected │ │ └── default.html │ └── src │ │ └── default.html ├── file_generation │ ├── expected │ │ ├── basic │ │ │ └── success.html │ │ └── default.html │ └── src │ │ └── default.html ├── file_generation_permalinks │ ├── expected │ │ ├── basic │ │ │ └── success │ │ │ │ └── index.html │ │ └── default.html │ └── src │ │ └── default.html ├── hbs_templates │ ├── expected │ │ ├── default.html │ │ └── post │ │ │ └── success.html │ ├── src │ │ └── default.html │ └── templates │ │ ├── post.hbs │ │ └── posts.hbs └── json │ └── basic.json └── index.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | root: true 2 | 3 | env: 4 | node: true 5 | es6: true 6 | 7 | parserOptions: 8 | ecmaVersion: 2018 9 | sourceType: module 10 | ecmaFeatures: 11 | globalReturn: true 12 | impliedStrict: true 13 | 14 | extends: 15 | - "eslint:recommended" 16 | - "prettier" 17 | 18 | plugins: 19 | - "prettier" 20 | 21 | rules: 22 | "prettier/prettier": "error" 23 | camelcase: 0 24 | no-console: 1 25 | quotes: [2, "single", "avoid-escape"] 26 | valid-jsdoc: [1, {requireParamDescription: false, requireReturnDescription: false}] 27 | -------------------------------------------------------------------------------- /.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 | 29 | # ESLint Cache 30 | .eslintcache 31 | 32 | # Ignore test build directories 33 | /test/**/build 34 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | package.json 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | singleQuote: true 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '6' 4 | - '7' 5 | - '8' 6 | - '9' 7 | - '10' 8 | - '11' 9 | - 'node' 10 | -------------------------------------------------------------------------------- /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 | # Metalsmith JSON to files plugin 2 | 3 | [![Build Status][travis-badge]][travis-url] 4 | 5 | [![npm version][npm-badge]][npm-url] 6 | [![code style: prettier][prettier-badge]][prettier-url] 7 | [![metalsmith: plugin][metalsmith-badge]][metalsmith-url] 8 | 9 | Creates files from supplied JSON 10 | 11 | A [Metalsmith](https://github.com/segmentio/metalsmith) plugin that lets you generate files from `JSON`. 12 | 13 | ## Features 14 | 15 | - Many `JSON` files can be located in one directory for processing 16 | - Filename is configurable and generated from `JSON` source file 17 | - Permalink style filenames make for pretty URLs 18 | 19 | ## Installation 20 | 21 | ```bash 22 | $ npm install metalsmith-json-to-files 23 | ``` 24 | 25 | ## Usage 26 | 27 | ### Initialise plugin 28 | 29 | ```js 30 | var json_to_files = require('metalsmith-json-to-files'); 31 | 32 | metalsmith.use( 33 | json_to_files({ 34 | source_path: '../path/to/json_files/' 35 | }) 36 | ); 37 | ``` 38 | 39 | ### Use plugin 40 | 41 | ```md 42 | --- 43 | name: My Posts 44 | template: posts.hbs 45 | json_files: 46 | source_file: posts 47 | filename_pattern: posts/:date-:fields.slug 48 | as_permalink: true 49 | template: post.hbs 50 | --- 51 | 52 | Take a look... 53 | ``` 54 | 55 | Any extra metadata within the `json_files` object will be passed through to the files it generates as `data.` 56 | 57 | ### Rename `data` object 58 | 59 | The `data` object can be renamed by including `rename_data_to` in the front matter: 60 | ```md 61 | --- 62 | name: My Posts 63 | template: posts.hbs 64 | json_files: 65 | rename_data_to: itemData 66 | --- 67 | ``` 68 | 69 | 70 | ## Examples 71 | 72 | See the [metalsmith-json-to-files CLI example](https://github.com/toddmorey/metalsmith-json-to-files-example) 73 | 74 | ## License 75 | 76 | GPL-2.0 77 | 78 | [travis-badge]: https://travis-ci.org/woodyrew/metalsmith-json-to-files.svg 79 | [travis-url]: https://travis-ci.org/woodyrew/metalsmith-json-to-files 80 | [npm-badge]: https://img.shields.io/npm/v/metalsmith-json-to-files.svg 81 | [npm-url]: https://www.npmjs.com/package/metalsmith-json-to-files 82 | [prettier-badge]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg 83 | [prettier-url]: https://github.com/prettier/prettier 84 | [metalsmith-badge]: https://img.shields.io/badge/metalsmith-plugin-green.svg?longCache=true 85 | [metalsmith-url]: http://metalsmith.io 86 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* eslint no-cond-assign: 1 */ 4 | 5 | const debug = require('debug'); 6 | const log = debug('metalsmith-json-to-files'); 7 | const error = debug('metalsmith-json-to-files:error'); 8 | 9 | const joi = require('joi'); 10 | const each = require('async').each; 11 | const path = require('path'); 12 | const slug = require('slug-component'); 13 | const jsonfile = require('jsonfile'); 14 | 15 | const resolve = require('lodash.get'); 16 | const extend = require('lodash.assign'); 17 | 18 | /** 19 | * Builds a filename out of a pattern if provided. 20 | * e.g. 21 | * :collection/:fields.slug 22 | * might return: 'pages/about' 23 | * 24 | * @param {String} filename_pattern 25 | * @param {Object} entry 26 | * @param {String} extension File extension 27 | * 28 | * @return {String} 29 | */ 30 | const build_filename = (filename_pattern, entry, extension) => { 31 | log('Building Filename from: %s', filename_pattern); 32 | 33 | extension = extension || '.html'; 34 | // Default filename 35 | let filename = 'not_found' + extension; 36 | 37 | /** 38 | * Get the params from a `pattern` string. 39 | * 40 | * @param {String} pattern 41 | * @return {Array} 42 | */ 43 | const get_params = function get_params(pattern) { 44 | /* eslint no-cond-assign: 0 */ 45 | const matcher = /:([\w]+(\.[\w]+)*)/g; 46 | const ret = []; 47 | let m; 48 | while ((m = matcher.exec(pattern))) { 49 | ret.push(m[1]); 50 | } 51 | return ret; 52 | }; 53 | 54 | if (entry.filename_pattern) { 55 | let pattern = entry.filename_pattern; 56 | const params = get_params(pattern); 57 | 58 | params.forEach(function(element) { 59 | const replacement = resolve(entry, element); 60 | if (replacement) { 61 | pattern = pattern.replace(':' + element, slug(replacement.toString())); 62 | } 63 | }); 64 | 65 | // Check all have been processed 66 | if (get_params(pattern).join('') === '') { 67 | filename = entry.as_permalink 68 | ? pattern + '/index' + extension 69 | : pattern + extension; 70 | } else { 71 | throw new TypeError("Couldn't build filename from: " + pattern); 72 | } 73 | } 74 | return filename; 75 | }; 76 | 77 | const options_schema = { 78 | source_path: joi.string().required(), 79 | properties_to_remove: joi.array() 80 | }; 81 | 82 | const metadata_schema = { 83 | source_file: joi.string().required(), 84 | filename_pattern: joi.string().required(), 85 | as_permalink: joi.boolean(), 86 | rename_data_to: joi.string() 87 | }; 88 | 89 | const metadata_schema_options = { 90 | allowUnknown: true 91 | }; 92 | 93 | /** 94 | * Metalsmith Plugin: Make files from a JSON source 95 | * 96 | * @param {Object} options 97 | * @param {String} options.source_path Path for source JSON files - Required 98 | * 99 | * @return {Function} Gets used by Metalsmith with .use 100 | */ 101 | const plugin = options => { 102 | options = options || {}; 103 | log('Options: %o', options); 104 | 105 | const properties_to_remove = 106 | options.properties_to_remove || Object.keys(metadata_schema); 107 | 108 | return (files, metalsmith, done) => { 109 | const keys = Object.keys(files); 110 | 111 | joi.validate(options, options_schema, err => { 112 | if (err) { 113 | error(err); 114 | done(new Error(err)); 115 | } 116 | }); 117 | 118 | /** 119 | * Uses the config from the source file and retrieves JSON data to produce files 120 | * 121 | * @param {String} file 122 | * 123 | * @return {Void} Appends to files var. 124 | */ 125 | const process_file = file => { 126 | const file_meta = files[file]; 127 | 128 | // json_files object is not present so don"t proceed. 129 | if (!file_meta.json_files) { 130 | log('No json_files metadata for %s', file); 131 | return; 132 | } 133 | 134 | // Validate metadata params 135 | joi.validate( 136 | file_meta.json_files, 137 | metadata_schema, 138 | metadata_schema_options, 139 | function(err) { 140 | if (err) { 141 | error(err); 142 | done(new Error(err)); 143 | } 144 | } 145 | ); 146 | 147 | const source_filepath = path.resolve( 148 | metalsmith.directory(), 149 | options.source_path + file_meta.json_files.source_file + '.json' 150 | ); 151 | 152 | // TODO: Check file exists and provide warning 153 | const json = jsonfile.readFileSync(source_filepath); 154 | 155 | // log('File json: %o', json); 156 | json.forEach(element => { 157 | const defaults = { contents: '' }; 158 | const meta = file_meta.json_files; 159 | 160 | let renamed_element_wrapper = {}; 161 | // use key from `rename_data_to`, or default to "data" 162 | renamed_element_wrapper[meta.rename_data_to || 'data'] = element; 163 | 164 | const data = extend(defaults, meta, renamed_element_wrapper); 165 | 166 | // Take into account the parent in build filename 167 | const filename = build_filename(data.filename_pattern, data); 168 | 169 | // Remove properties that are no longer needed. 170 | properties_to_remove.forEach(property_to_remove => { 171 | delete data[property_to_remove]; 172 | }); 173 | 174 | files[filename] = data; 175 | }); 176 | }; 177 | 178 | // Process through each of the files 179 | each(keys, process_file); 180 | done(); 181 | }; 182 | }; 183 | 184 | module.exports = plugin; 185 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "metalsmith-json-to-files", 3 | "version": "2.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.0.0", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", 10 | "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", 11 | "dev": true, 12 | "requires": { 13 | "@babel/highlight": "^7.0.0" 14 | } 15 | }, 16 | "@babel/highlight": { 17 | "version": "7.0.0", 18 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", 19 | "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", 20 | "dev": true, 21 | "requires": { 22 | "chalk": "^2.0.0", 23 | "esutils": "^2.0.2", 24 | "js-tokens": "^4.0.0" 25 | }, 26 | "dependencies": { 27 | "ansi-styles": { 28 | "version": "3.2.1", 29 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 30 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 31 | "dev": true, 32 | "requires": { 33 | "color-convert": "^1.9.0" 34 | } 35 | }, 36 | "chalk": { 37 | "version": "2.4.2", 38 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 39 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 40 | "dev": true, 41 | "requires": { 42 | "ansi-styles": "^3.2.1", 43 | "escape-string-regexp": "^1.0.5", 44 | "supports-color": "^5.3.0" 45 | } 46 | }, 47 | "supports-color": { 48 | "version": "5.5.0", 49 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 50 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 51 | "dev": true, 52 | "requires": { 53 | "has-flag": "^3.0.0" 54 | } 55 | } 56 | } 57 | }, 58 | "absolute": { 59 | "version": "0.0.1", 60 | "resolved": "https://registry.npmjs.org/absolute/-/absolute-0.0.1.tgz", 61 | "integrity": "sha1-wigi+H4ck59XmIdQTZwQnEFzgp0=", 62 | "dev": true 63 | }, 64 | "acorn": { 65 | "version": "6.0.7", 66 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.7.tgz", 67 | "integrity": "sha512-HNJNgE60C9eOTgn974Tlp3dpLZdUr+SoxxDwPaY9J/kDNOLQTkaDgwBUXAF4SSsrAwD9RpdxuHK/EbuF+W9Ahw==", 68 | "dev": true 69 | }, 70 | "acorn-jsx": { 71 | "version": "5.0.1", 72 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", 73 | "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", 74 | "dev": true 75 | }, 76 | "ajv": { 77 | "version": "6.8.1", 78 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", 79 | "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", 80 | "dev": true, 81 | "requires": { 82 | "fast-deep-equal": "^2.0.1", 83 | "fast-json-stable-stringify": "^2.0.0", 84 | "json-schema-traverse": "^0.4.1", 85 | "uri-js": "^4.2.2" 86 | } 87 | }, 88 | "ansi-escapes": { 89 | "version": "3.2.0", 90 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", 91 | "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", 92 | "dev": true 93 | }, 94 | "ansi-red": { 95 | "version": "0.1.1", 96 | "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", 97 | "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", 98 | "dev": true, 99 | "requires": { 100 | "ansi-wrap": "0.1.0" 101 | } 102 | }, 103 | "ansi-regex": { 104 | "version": "2.1.1", 105 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 106 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 107 | "dev": true 108 | }, 109 | "ansi-styles": { 110 | "version": "2.2.1", 111 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 112 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", 113 | "dev": true 114 | }, 115 | "ansi-wrap": { 116 | "version": "0.1.0", 117 | "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", 118 | "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", 119 | "dev": true 120 | }, 121 | "argparse": { 122 | "version": "1.0.10", 123 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 124 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 125 | "dev": true, 126 | "requires": { 127 | "sprintf-js": "~1.0.2" 128 | } 129 | }, 130 | "assert-dir-equal": { 131 | "version": "1.1.0", 132 | "resolved": "https://registry.npmjs.org/assert-dir-equal/-/assert-dir-equal-1.1.0.tgz", 133 | "integrity": "sha1-nOsU3IHeguz4NmJIaM0bWP/C9fs=", 134 | "dev": true, 135 | "requires": { 136 | "buffer-equal": "0.0.0", 137 | "fs-readdir-recursive": "0.0.1", 138 | "is-utf8": "~0.2.0" 139 | } 140 | }, 141 | "assertion-error": { 142 | "version": "1.1.0", 143 | "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", 144 | "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", 145 | "dev": true 146 | }, 147 | "astral-regex": { 148 | "version": "1.0.0", 149 | "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", 150 | "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", 151 | "dev": true 152 | }, 153 | "async": { 154 | "version": "2.6.1", 155 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", 156 | "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", 157 | "requires": { 158 | "lodash": "^4.17.10" 159 | }, 160 | "dependencies": { 161 | "lodash": { 162 | "version": "4.17.11", 163 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 164 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 165 | } 166 | } 167 | }, 168 | "balanced-match": { 169 | "version": "1.0.0", 170 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 171 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 172 | "dev": true 173 | }, 174 | "brace-expansion": { 175 | "version": "1.1.11", 176 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 177 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 178 | "dev": true, 179 | "requires": { 180 | "balanced-match": "^1.0.0", 181 | "concat-map": "0.0.1" 182 | } 183 | }, 184 | "browser-stdout": { 185 | "version": "1.3.1", 186 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 187 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 188 | "dev": true 189 | }, 190 | "buffer-equal": { 191 | "version": "0.0.0", 192 | "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.0.tgz", 193 | "integrity": "sha1-SmgZasM1ItqhfsmYWLMCpja2LPE=", 194 | "dev": true 195 | }, 196 | "callsites": { 197 | "version": "3.0.0", 198 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", 199 | "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", 200 | "dev": true 201 | }, 202 | "chai": { 203 | "version": "4.2.0", 204 | "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", 205 | "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", 206 | "dev": true, 207 | "requires": { 208 | "assertion-error": "^1.1.0", 209 | "check-error": "^1.0.2", 210 | "deep-eql": "^3.0.1", 211 | "get-func-name": "^2.0.0", 212 | "pathval": "^1.1.0", 213 | "type-detect": "^4.0.5" 214 | } 215 | }, 216 | "chalk": { 217 | "version": "1.1.3", 218 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 219 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 220 | "dev": true, 221 | "requires": { 222 | "ansi-styles": "^2.2.1", 223 | "escape-string-regexp": "^1.0.2", 224 | "has-ansi": "^2.0.0", 225 | "strip-ansi": "^3.0.0", 226 | "supports-color": "^2.0.0" 227 | } 228 | }, 229 | "chardet": { 230 | "version": "0.7.0", 231 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", 232 | "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", 233 | "dev": true 234 | }, 235 | "check-error": { 236 | "version": "1.0.2", 237 | "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", 238 | "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", 239 | "dev": true 240 | }, 241 | "circular-json": { 242 | "version": "0.3.3", 243 | "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", 244 | "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", 245 | "dev": true 246 | }, 247 | "cli-cursor": { 248 | "version": "2.1.0", 249 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 250 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", 251 | "dev": true, 252 | "requires": { 253 | "restore-cursor": "^2.0.0" 254 | } 255 | }, 256 | "cli-width": { 257 | "version": "2.2.0", 258 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", 259 | "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", 260 | "dev": true 261 | }, 262 | "clone": { 263 | "version": "1.0.4", 264 | "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", 265 | "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", 266 | "dev": true 267 | }, 268 | "co": { 269 | "version": "3.1.0", 270 | "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", 271 | "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=", 272 | "dev": true 273 | }, 274 | "co-from-stream": { 275 | "version": "0.0.0", 276 | "resolved": "https://registry.npmjs.org/co-from-stream/-/co-from-stream-0.0.0.tgz", 277 | "integrity": "sha1-GlzYztdyY5RglPo58kmaYyl7yvk=", 278 | "dev": true, 279 | "requires": { 280 | "co-read": "0.0.1" 281 | } 282 | }, 283 | "co-fs-extra": { 284 | "version": "1.2.1", 285 | "resolved": "https://registry.npmjs.org/co-fs-extra/-/co-fs-extra-1.2.1.tgz", 286 | "integrity": "sha1-O2rXfPJhRTD2d7HPYmZPW6dWtyI=", 287 | "dev": true, 288 | "requires": { 289 | "co-from-stream": "~0.0.0", 290 | "fs-extra": "~0.26.5", 291 | "thunkify-wrap": "~1.0.4" 292 | } 293 | }, 294 | "co-read": { 295 | "version": "0.0.1", 296 | "resolved": "https://registry.npmjs.org/co-read/-/co-read-0.0.1.tgz", 297 | "integrity": "sha1-+Bs+uKhmdf7FHj2IOn9WToc8k4k=", 298 | "dev": true 299 | }, 300 | "coffee-script": { 301 | "version": "1.12.7", 302 | "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", 303 | "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==", 304 | "dev": true 305 | }, 306 | "color-convert": { 307 | "version": "1.9.3", 308 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 309 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 310 | "dev": true, 311 | "requires": { 312 | "color-name": "1.1.3" 313 | } 314 | }, 315 | "color-name": { 316 | "version": "1.1.3", 317 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 318 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 319 | "dev": true 320 | }, 321 | "commander": { 322 | "version": "2.17.1", 323 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", 324 | "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", 325 | "dev": true 326 | }, 327 | "concat-map": { 328 | "version": "0.0.1", 329 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 330 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 331 | "dev": true 332 | }, 333 | "consolidate": { 334 | "version": "0.10.0", 335 | "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.10.0.tgz", 336 | "integrity": "sha1-gfGmzroSR9+c73omHOUnws5Tj3o=", 337 | "dev": true 338 | }, 339 | "cross-spawn": { 340 | "version": "6.0.5", 341 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 342 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 343 | "dev": true, 344 | "requires": { 345 | "nice-try": "^1.0.4", 346 | "path-key": "^2.0.1", 347 | "semver": "^5.5.0", 348 | "shebang-command": "^1.2.0", 349 | "which": "^1.2.9" 350 | } 351 | }, 352 | "debug": { 353 | "version": "4.1.1", 354 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 355 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 356 | "requires": { 357 | "ms": "^2.1.1" 358 | } 359 | }, 360 | "deep-eql": { 361 | "version": "3.0.1", 362 | "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", 363 | "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", 364 | "dev": true, 365 | "requires": { 366 | "type-detect": "^4.0.0" 367 | } 368 | }, 369 | "deep-is": { 370 | "version": "0.1.3", 371 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 372 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 373 | "dev": true 374 | }, 375 | "diff": { 376 | "version": "3.5.0", 377 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 378 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 379 | "dev": true 380 | }, 381 | "doctrine": { 382 | "version": "2.1.0", 383 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", 384 | "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", 385 | "dev": true, 386 | "requires": { 387 | "esutils": "^2.0.2" 388 | } 389 | }, 390 | "enable": { 391 | "version": "1.3.2", 392 | "resolved": "https://registry.npmjs.org/enable/-/enable-1.3.2.tgz", 393 | "integrity": "sha1-nrpoN9FtCYK1n4fYib91REPVKTE=", 394 | "dev": true 395 | }, 396 | "escape-string-regexp": { 397 | "version": "1.0.5", 398 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 399 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 400 | "dev": true 401 | }, 402 | "eslint": { 403 | "version": "5.13.0", 404 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.13.0.tgz", 405 | "integrity": "sha512-nqD5WQMisciZC5EHZowejLKQjWGuFS5c70fxqSKlnDME+oz9zmE8KTlX+lHSg+/5wsC/kf9Q9eMkC8qS3oM2fg==", 406 | "dev": true, 407 | "requires": { 408 | "@babel/code-frame": "^7.0.0", 409 | "ajv": "^6.5.3", 410 | "chalk": "^2.1.0", 411 | "cross-spawn": "^6.0.5", 412 | "debug": "^4.0.1", 413 | "doctrine": "^2.1.0", 414 | "eslint-scope": "^4.0.0", 415 | "eslint-utils": "^1.3.1", 416 | "eslint-visitor-keys": "^1.0.0", 417 | "espree": "^5.0.0", 418 | "esquery": "^1.0.1", 419 | "esutils": "^2.0.2", 420 | "file-entry-cache": "^2.0.0", 421 | "functional-red-black-tree": "^1.0.1", 422 | "glob": "^7.1.2", 423 | "globals": "^11.7.0", 424 | "ignore": "^4.0.6", 425 | "import-fresh": "^3.0.0", 426 | "imurmurhash": "^0.1.4", 427 | "inquirer": "^6.1.0", 428 | "js-yaml": "^3.12.0", 429 | "json-stable-stringify-without-jsonify": "^1.0.1", 430 | "levn": "^0.3.0", 431 | "lodash": "^4.17.5", 432 | "minimatch": "^3.0.4", 433 | "mkdirp": "^0.5.1", 434 | "natural-compare": "^1.4.0", 435 | "optionator": "^0.8.2", 436 | "path-is-inside": "^1.0.2", 437 | "progress": "^2.0.0", 438 | "regexpp": "^2.0.1", 439 | "semver": "^5.5.1", 440 | "strip-ansi": "^4.0.0", 441 | "strip-json-comments": "^2.0.1", 442 | "table": "^5.0.2", 443 | "text-table": "^0.2.0" 444 | }, 445 | "dependencies": { 446 | "ansi-regex": { 447 | "version": "3.0.0", 448 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 449 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", 450 | "dev": true 451 | }, 452 | "ansi-styles": { 453 | "version": "3.2.1", 454 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 455 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 456 | "dev": true, 457 | "requires": { 458 | "color-convert": "^1.9.0" 459 | } 460 | }, 461 | "chalk": { 462 | "version": "2.4.2", 463 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 464 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 465 | "dev": true, 466 | "requires": { 467 | "ansi-styles": "^3.2.1", 468 | "escape-string-regexp": "^1.0.5", 469 | "supports-color": "^5.3.0" 470 | } 471 | }, 472 | "strip-ansi": { 473 | "version": "4.0.0", 474 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 475 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 476 | "dev": true, 477 | "requires": { 478 | "ansi-regex": "^3.0.0" 479 | } 480 | }, 481 | "supports-color": { 482 | "version": "5.5.0", 483 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 484 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 485 | "dev": true, 486 | "requires": { 487 | "has-flag": "^3.0.0" 488 | } 489 | } 490 | } 491 | }, 492 | "eslint-config-prettier": { 493 | "version": "4.0.0", 494 | "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-4.0.0.tgz", 495 | "integrity": "sha512-kWuiJxzV5NwOwZcpyozTzDT5KJhBw292bbYro9Is7BWnbNMg15Gmpluc1CTetiCatF8DRkNvgPAOaSyg+bYr3g==", 496 | "dev": true, 497 | "requires": { 498 | "get-stdin": "^6.0.0" 499 | } 500 | }, 501 | "eslint-plugin-prettier": { 502 | "version": "3.0.1", 503 | "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz", 504 | "integrity": "sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ==", 505 | "dev": true, 506 | "requires": { 507 | "prettier-linter-helpers": "^1.0.0" 508 | } 509 | }, 510 | "eslint-scope": { 511 | "version": "4.0.0", 512 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", 513 | "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", 514 | "dev": true, 515 | "requires": { 516 | "esrecurse": "^4.1.0", 517 | "estraverse": "^4.1.1" 518 | } 519 | }, 520 | "eslint-utils": { 521 | "version": "1.3.1", 522 | "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", 523 | "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", 524 | "dev": true 525 | }, 526 | "eslint-visitor-keys": { 527 | "version": "1.0.0", 528 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", 529 | "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", 530 | "dev": true 531 | }, 532 | "espree": { 533 | "version": "5.0.0", 534 | "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", 535 | "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", 536 | "dev": true, 537 | "requires": { 538 | "acorn": "^6.0.2", 539 | "acorn-jsx": "^5.0.0", 540 | "eslint-visitor-keys": "^1.0.0" 541 | } 542 | }, 543 | "esprima": { 544 | "version": "4.0.1", 545 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 546 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 547 | "dev": true 548 | }, 549 | "esquery": { 550 | "version": "1.0.1", 551 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", 552 | "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", 553 | "dev": true, 554 | "requires": { 555 | "estraverse": "^4.0.0" 556 | } 557 | }, 558 | "esrecurse": { 559 | "version": "4.2.1", 560 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", 561 | "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", 562 | "dev": true, 563 | "requires": { 564 | "estraverse": "^4.1.0" 565 | } 566 | }, 567 | "estraverse": { 568 | "version": "4.2.0", 569 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", 570 | "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", 571 | "dev": true 572 | }, 573 | "esutils": { 574 | "version": "2.0.2", 575 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 576 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 577 | "dev": true 578 | }, 579 | "extend": { 580 | "version": "1.2.1", 581 | "resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz", 582 | "integrity": "sha1-oPX9bPyDpf5J72mNYOyKYk3UV2w=", 583 | "dev": true 584 | }, 585 | "extend-shallow": { 586 | "version": "2.0.1", 587 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 588 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 589 | "dev": true, 590 | "requires": { 591 | "is-extendable": "^0.1.0" 592 | } 593 | }, 594 | "external-editor": { 595 | "version": "3.0.3", 596 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", 597 | "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", 598 | "dev": true, 599 | "requires": { 600 | "chardet": "^0.7.0", 601 | "iconv-lite": "^0.4.24", 602 | "tmp": "^0.0.33" 603 | } 604 | }, 605 | "fast-deep-equal": { 606 | "version": "2.0.1", 607 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 608 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", 609 | "dev": true 610 | }, 611 | "fast-diff": { 612 | "version": "1.2.0", 613 | "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", 614 | "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", 615 | "dev": true 616 | }, 617 | "fast-json-stable-stringify": { 618 | "version": "2.0.0", 619 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 620 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", 621 | "dev": true 622 | }, 623 | "fast-levenshtein": { 624 | "version": "2.0.6", 625 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 626 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 627 | "dev": true 628 | }, 629 | "figures": { 630 | "version": "2.0.0", 631 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", 632 | "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", 633 | "dev": true, 634 | "requires": { 635 | "escape-string-regexp": "^1.0.5" 636 | } 637 | }, 638 | "file-entry-cache": { 639 | "version": "2.0.0", 640 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", 641 | "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", 642 | "dev": true, 643 | "requires": { 644 | "flat-cache": "^1.2.1", 645 | "object-assign": "^4.0.1" 646 | } 647 | }, 648 | "flat-cache": { 649 | "version": "1.3.4", 650 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", 651 | "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", 652 | "dev": true, 653 | "requires": { 654 | "circular-json": "^0.3.1", 655 | "graceful-fs": "^4.1.2", 656 | "rimraf": "~2.6.2", 657 | "write": "^0.2.1" 658 | } 659 | }, 660 | "fs-extra": { 661 | "version": "0.26.7", 662 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", 663 | "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", 664 | "dev": true, 665 | "requires": { 666 | "graceful-fs": "^4.1.2", 667 | "jsonfile": "^2.1.0", 668 | "klaw": "^1.0.0", 669 | "path-is-absolute": "^1.0.0", 670 | "rimraf": "^2.2.8" 671 | }, 672 | "dependencies": { 673 | "jsonfile": { 674 | "version": "2.4.0", 675 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", 676 | "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", 677 | "dev": true, 678 | "requires": { 679 | "graceful-fs": "^4.1.6" 680 | } 681 | } 682 | } 683 | }, 684 | "fs-readdir-recursive": { 685 | "version": "0.0.1", 686 | "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-0.0.1.tgz", 687 | "integrity": "sha1-8iI6tAKT5DZpbTO2f2s+bS5qjBI=", 688 | "dev": true 689 | }, 690 | "fs.realpath": { 691 | "version": "1.0.0", 692 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 693 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 694 | "dev": true 695 | }, 696 | "functional-red-black-tree": { 697 | "version": "1.0.1", 698 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", 699 | "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", 700 | "dev": true 701 | }, 702 | "get-func-name": { 703 | "version": "2.0.0", 704 | "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", 705 | "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", 706 | "dev": true 707 | }, 708 | "get-stdin": { 709 | "version": "6.0.0", 710 | "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", 711 | "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", 712 | "dev": true 713 | }, 714 | "glob": { 715 | "version": "7.1.3", 716 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 717 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 718 | "dev": true, 719 | "requires": { 720 | "fs.realpath": "^1.0.0", 721 | "inflight": "^1.0.4", 722 | "inherits": "2", 723 | "minimatch": "^3.0.4", 724 | "once": "^1.3.0", 725 | "path-is-absolute": "^1.0.0" 726 | } 727 | }, 728 | "globals": { 729 | "version": "11.10.0", 730 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", 731 | "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", 732 | "dev": true 733 | }, 734 | "graceful-fs": { 735 | "version": "4.1.15", 736 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", 737 | "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" 738 | }, 739 | "gray-matter": { 740 | "version": "2.1.1", 741 | "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-2.1.1.tgz", 742 | "integrity": "sha1-MELZrewqHe1qdwep7SOA+KF6Qw4=", 743 | "dev": true, 744 | "requires": { 745 | "ansi-red": "^0.1.1", 746 | "coffee-script": "^1.12.4", 747 | "extend-shallow": "^2.0.1", 748 | "js-yaml": "^3.8.1", 749 | "toml": "^2.3.2" 750 | }, 751 | "dependencies": { 752 | "esprima": { 753 | "version": "4.0.1", 754 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 755 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 756 | "dev": true 757 | }, 758 | "js-yaml": { 759 | "version": "3.12.1", 760 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", 761 | "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", 762 | "dev": true, 763 | "requires": { 764 | "argparse": "^1.0.7", 765 | "esprima": "^4.0.0" 766 | } 767 | } 768 | } 769 | }, 770 | "growl": { 771 | "version": "1.10.5", 772 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", 773 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", 774 | "dev": true 775 | }, 776 | "handlebars": { 777 | "version": "4.0.12", 778 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", 779 | "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", 780 | "dev": true, 781 | "requires": { 782 | "async": "^2.5.0", 783 | "optimist": "^0.6.1", 784 | "source-map": "^0.6.1", 785 | "uglify-js": "^3.1.4" 786 | }, 787 | "dependencies": { 788 | "async": { 789 | "version": "2.6.1", 790 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", 791 | "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", 792 | "dev": true, 793 | "requires": { 794 | "lodash": "^4.17.10" 795 | } 796 | }, 797 | "lodash": { 798 | "version": "4.17.11", 799 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 800 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", 801 | "dev": true 802 | } 803 | } 804 | }, 805 | "has-ansi": { 806 | "version": "2.0.0", 807 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 808 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 809 | "dev": true, 810 | "requires": { 811 | "ansi-regex": "^2.0.0" 812 | } 813 | }, 814 | "has-flag": { 815 | "version": "3.0.0", 816 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 817 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 818 | "dev": true 819 | }, 820 | "has-generators": { 821 | "version": "1.0.1", 822 | "resolved": "https://registry.npmjs.org/has-generators/-/has-generators-1.0.1.tgz", 823 | "integrity": "sha1-pqLlVIYBGUBILhPiyTeRxEms9Ek=", 824 | "dev": true 825 | }, 826 | "he": { 827 | "version": "1.1.1", 828 | "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", 829 | "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", 830 | "dev": true 831 | }, 832 | "hoek": { 833 | "version": "6.1.2", 834 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.2.tgz", 835 | "integrity": "sha512-6qhh/wahGYZHFSFw12tBbJw5fsAhhwrrG/y3Cs0YMTv2WzMnL0oLPnQJjv1QJvEfylRSOFuP+xCu+tdx0tD16Q==" 836 | }, 837 | "iconv-lite": { 838 | "version": "0.4.24", 839 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 840 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 841 | "dev": true, 842 | "requires": { 843 | "safer-buffer": ">= 2.1.2 < 3" 844 | } 845 | }, 846 | "ignore": { 847 | "version": "4.0.6", 848 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", 849 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", 850 | "dev": true 851 | }, 852 | "import-fresh": { 853 | "version": "3.0.0", 854 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", 855 | "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", 856 | "dev": true, 857 | "requires": { 858 | "parent-module": "^1.0.0", 859 | "resolve-from": "^4.0.0" 860 | } 861 | }, 862 | "imurmurhash": { 863 | "version": "0.1.4", 864 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 865 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", 866 | "dev": true 867 | }, 868 | "inflight": { 869 | "version": "1.0.6", 870 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 871 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 872 | "dev": true, 873 | "requires": { 874 | "once": "^1.3.0", 875 | "wrappy": "1" 876 | } 877 | }, 878 | "inherits": { 879 | "version": "2.0.3", 880 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 881 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 882 | "dev": true 883 | }, 884 | "inquirer": { 885 | "version": "6.2.2", 886 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", 887 | "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", 888 | "dev": true, 889 | "requires": { 890 | "ansi-escapes": "^3.2.0", 891 | "chalk": "^2.4.2", 892 | "cli-cursor": "^2.1.0", 893 | "cli-width": "^2.0.0", 894 | "external-editor": "^3.0.3", 895 | "figures": "^2.0.0", 896 | "lodash": "^4.17.11", 897 | "mute-stream": "0.0.7", 898 | "run-async": "^2.2.0", 899 | "rxjs": "^6.4.0", 900 | "string-width": "^2.1.0", 901 | "strip-ansi": "^5.0.0", 902 | "through": "^2.3.6" 903 | }, 904 | "dependencies": { 905 | "ansi-regex": { 906 | "version": "4.0.0", 907 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", 908 | "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", 909 | "dev": true 910 | }, 911 | "ansi-styles": { 912 | "version": "3.2.1", 913 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 914 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 915 | "dev": true, 916 | "requires": { 917 | "color-convert": "^1.9.0" 918 | } 919 | }, 920 | "chalk": { 921 | "version": "2.4.2", 922 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 923 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 924 | "dev": true, 925 | "requires": { 926 | "ansi-styles": "^3.2.1", 927 | "escape-string-regexp": "^1.0.5", 928 | "supports-color": "^5.3.0" 929 | } 930 | }, 931 | "strip-ansi": { 932 | "version": "5.0.0", 933 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", 934 | "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", 935 | "dev": true, 936 | "requires": { 937 | "ansi-regex": "^4.0.0" 938 | } 939 | }, 940 | "supports-color": { 941 | "version": "5.5.0", 942 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 943 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 944 | "dev": true, 945 | "requires": { 946 | "has-flag": "^3.0.0" 947 | } 948 | } 949 | } 950 | }, 951 | "is": { 952 | "version": "3.3.0", 953 | "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", 954 | "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", 955 | "dev": true 956 | }, 957 | "is-extendable": { 958 | "version": "0.1.1", 959 | "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", 960 | "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", 961 | "dev": true 962 | }, 963 | "is-fullwidth-code-point": { 964 | "version": "2.0.0", 965 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 966 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", 967 | "dev": true 968 | }, 969 | "is-promise": { 970 | "version": "2.1.0", 971 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 972 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", 973 | "dev": true 974 | }, 975 | "is-utf8": { 976 | "version": "0.2.1", 977 | "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", 978 | "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", 979 | "dev": true 980 | }, 981 | "isemail": { 982 | "version": "3.2.0", 983 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", 984 | "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", 985 | "requires": { 986 | "punycode": "2.x.x" 987 | } 988 | }, 989 | "isexe": { 990 | "version": "2.0.0", 991 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 992 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 993 | "dev": true 994 | }, 995 | "joi": { 996 | "version": "14.3.1", 997 | "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz", 998 | "integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==", 999 | "requires": { 1000 | "hoek": "6.x.x", 1001 | "isemail": "3.x.x", 1002 | "topo": "3.x.x" 1003 | } 1004 | }, 1005 | "js-tokens": { 1006 | "version": "4.0.0", 1007 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 1008 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 1009 | "dev": true 1010 | }, 1011 | "js-yaml": { 1012 | "version": "3.12.1", 1013 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", 1014 | "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", 1015 | "dev": true, 1016 | "requires": { 1017 | "argparse": "^1.0.7", 1018 | "esprima": "^4.0.0" 1019 | } 1020 | }, 1021 | "json-schema-traverse": { 1022 | "version": "0.4.1", 1023 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 1024 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 1025 | "dev": true 1026 | }, 1027 | "json-stable-stringify-without-jsonify": { 1028 | "version": "1.0.1", 1029 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 1030 | "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", 1031 | "dev": true 1032 | }, 1033 | "jsonfile": { 1034 | "version": "5.0.0", 1035 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-5.0.0.tgz", 1036 | "integrity": "sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==", 1037 | "requires": { 1038 | "graceful-fs": "^4.1.6", 1039 | "universalify": "^0.1.2" 1040 | } 1041 | }, 1042 | "klaw": { 1043 | "version": "1.3.1", 1044 | "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", 1045 | "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", 1046 | "dev": true, 1047 | "requires": { 1048 | "graceful-fs": "^4.1.9" 1049 | } 1050 | }, 1051 | "levn": { 1052 | "version": "0.3.0", 1053 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 1054 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 1055 | "dev": true, 1056 | "requires": { 1057 | "prelude-ls": "~1.1.2", 1058 | "type-check": "~0.3.2" 1059 | } 1060 | }, 1061 | "lodash": { 1062 | "version": "4.17.11", 1063 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 1064 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", 1065 | "dev": true 1066 | }, 1067 | "lodash._arraypool": { 1068 | "version": "2.4.1", 1069 | "resolved": "https://registry.npmjs.org/lodash._arraypool/-/lodash._arraypool-2.4.1.tgz", 1070 | "integrity": "sha1-6I7suS4ruEyQZWEv2VigcZzUf5Q=", 1071 | "dev": true 1072 | }, 1073 | "lodash._basebind": { 1074 | "version": "2.4.1", 1075 | "resolved": "https://registry.npmjs.org/lodash._basebind/-/lodash._basebind-2.4.1.tgz", 1076 | "integrity": "sha1-6UC5690nwyfgqNqxtVkWxTQelXU=", 1077 | "dev": true, 1078 | "requires": { 1079 | "lodash._basecreate": "~2.4.1", 1080 | "lodash._setbinddata": "~2.4.1", 1081 | "lodash._slice": "~2.4.1", 1082 | "lodash.isobject": "~2.4.1" 1083 | } 1084 | }, 1085 | "lodash._basecreate": { 1086 | "version": "2.4.1", 1087 | "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-2.4.1.tgz", 1088 | "integrity": "sha1-+Ob1tXip405UEXm1a47uv0oofgg=", 1089 | "dev": true, 1090 | "requires": { 1091 | "lodash._isnative": "~2.4.1", 1092 | "lodash.isobject": "~2.4.1", 1093 | "lodash.noop": "~2.4.1" 1094 | } 1095 | }, 1096 | "lodash._basecreatecallback": { 1097 | "version": "2.4.1", 1098 | "resolved": "https://registry.npmjs.org/lodash._basecreatecallback/-/lodash._basecreatecallback-2.4.1.tgz", 1099 | "integrity": "sha1-fQsmdknLKeehOdAQO3wR+uhOSFE=", 1100 | "dev": true, 1101 | "requires": { 1102 | "lodash._setbinddata": "~2.4.1", 1103 | "lodash.bind": "~2.4.1", 1104 | "lodash.identity": "~2.4.1", 1105 | "lodash.support": "~2.4.1" 1106 | } 1107 | }, 1108 | "lodash._basecreatewrapper": { 1109 | "version": "2.4.1", 1110 | "resolved": "https://registry.npmjs.org/lodash._basecreatewrapper/-/lodash._basecreatewrapper-2.4.1.tgz", 1111 | "integrity": "sha1-TTHy595+E0+/KAN2K4FQsyUZZm8=", 1112 | "dev": true, 1113 | "requires": { 1114 | "lodash._basecreate": "~2.4.1", 1115 | "lodash._setbinddata": "~2.4.1", 1116 | "lodash._slice": "~2.4.1", 1117 | "lodash.isobject": "~2.4.1" 1118 | } 1119 | }, 1120 | "lodash._baseisequal": { 1121 | "version": "2.4.1", 1122 | "resolved": "https://registry.npmjs.org/lodash._baseisequal/-/lodash._baseisequal-2.4.1.tgz", 1123 | "integrity": "sha1-ax5i5YfFUjER9vIoVT2rGeRF/AM=", 1124 | "dev": true, 1125 | "requires": { 1126 | "lodash._getarray": "~2.4.1", 1127 | "lodash._objecttypes": "~2.4.1", 1128 | "lodash._releasearray": "~2.4.1", 1129 | "lodash.forin": "~2.4.1", 1130 | "lodash.isfunction": "~2.4.1" 1131 | } 1132 | }, 1133 | "lodash._cachepush": { 1134 | "version": "2.4.1", 1135 | "resolved": "https://registry.npmjs.org/lodash._cachepush/-/lodash._cachepush-2.4.1.tgz", 1136 | "integrity": "sha1-z97RJYuRm3om1rASZmpYSXIzCJk=", 1137 | "dev": true, 1138 | "requires": { 1139 | "lodash._keyprefix": "~2.4.1" 1140 | } 1141 | }, 1142 | "lodash._createwrapper": { 1143 | "version": "2.4.1", 1144 | "resolved": "https://registry.npmjs.org/lodash._createwrapper/-/lodash._createwrapper-2.4.1.tgz", 1145 | "integrity": "sha1-UdaVeXPaTtVW43KQ2MGhjFPeFgc=", 1146 | "dev": true, 1147 | "requires": { 1148 | "lodash._basebind": "~2.4.1", 1149 | "lodash._basecreatewrapper": "~2.4.1", 1150 | "lodash._slice": "~2.4.1", 1151 | "lodash.isfunction": "~2.4.1" 1152 | } 1153 | }, 1154 | "lodash._getarray": { 1155 | "version": "2.4.1", 1156 | "resolved": "https://registry.npmjs.org/lodash._getarray/-/lodash._getarray-2.4.1.tgz", 1157 | "integrity": "sha1-+vH3+BD6mFolHCGHQESBCUg55e4=", 1158 | "dev": true, 1159 | "requires": { 1160 | "lodash._arraypool": "~2.4.1" 1161 | } 1162 | }, 1163 | "lodash._getobject": { 1164 | "version": "2.4.1", 1165 | "resolved": "https://registry.npmjs.org/lodash._getobject/-/lodash._getobject-2.4.1.tgz", 1166 | "integrity": "sha1-Q4B1pQRudyOOHWoBRXtTV6W1yxY=", 1167 | "dev": true, 1168 | "requires": { 1169 | "lodash._objectpool": "~2.4.1" 1170 | } 1171 | }, 1172 | "lodash._isnative": { 1173 | "version": "2.4.1", 1174 | "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", 1175 | "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=", 1176 | "dev": true 1177 | }, 1178 | "lodash._keyprefix": { 1179 | "version": "2.4.2", 1180 | "resolved": "https://registry.npmjs.org/lodash._keyprefix/-/lodash._keyprefix-2.4.2.tgz", 1181 | "integrity": "sha1-GOQp0NveIAOVg1HH0utmTzdPhVg=", 1182 | "dev": true 1183 | }, 1184 | "lodash._largearraysize": { 1185 | "version": "2.4.1", 1186 | "resolved": "https://registry.npmjs.org/lodash._largearraysize/-/lodash._largearraysize-2.4.1.tgz", 1187 | "integrity": "sha1-jTj/N45ge65VQ1WSOph02xF8o6g=", 1188 | "dev": true 1189 | }, 1190 | "lodash._maxpoolsize": { 1191 | "version": "2.4.1", 1192 | "resolved": "https://registry.npmjs.org/lodash._maxpoolsize/-/lodash._maxpoolsize-2.4.1.tgz", 1193 | "integrity": "sha1-nUgvRjuOZq++WcLBTtsRcGAXIzQ=", 1194 | "dev": true 1195 | }, 1196 | "lodash._objectpool": { 1197 | "version": "2.4.1", 1198 | "resolved": "https://registry.npmjs.org/lodash._objectpool/-/lodash._objectpool-2.4.1.tgz", 1199 | "integrity": "sha1-UssUtmaHuuoIDb91FlKNA+Ud6bE=", 1200 | "dev": true 1201 | }, 1202 | "lodash._objecttypes": { 1203 | "version": "2.4.1", 1204 | "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", 1205 | "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=", 1206 | "dev": true 1207 | }, 1208 | "lodash._releasearray": { 1209 | "version": "2.4.1", 1210 | "resolved": "https://registry.npmjs.org/lodash._releasearray/-/lodash._releasearray-2.4.1.tgz", 1211 | "integrity": "sha1-phOWMNdtFTawfdyAliiJsIL2pkE=", 1212 | "dev": true, 1213 | "requires": { 1214 | "lodash._arraypool": "~2.4.1", 1215 | "lodash._maxpoolsize": "~2.4.1" 1216 | } 1217 | }, 1218 | "lodash._releaseobject": { 1219 | "version": "2.4.1", 1220 | "resolved": "https://registry.npmjs.org/lodash._releaseobject/-/lodash._releaseobject-2.4.1.tgz", 1221 | "integrity": "sha1-oBjnG+cEZRDrq60TzVHdLBRQWTg=", 1222 | "dev": true, 1223 | "requires": { 1224 | "lodash._maxpoolsize": "~2.4.1", 1225 | "lodash._objectpool": "~2.4.1" 1226 | } 1227 | }, 1228 | "lodash._setbinddata": { 1229 | "version": "2.4.1", 1230 | "resolved": "https://registry.npmjs.org/lodash._setbinddata/-/lodash._setbinddata-2.4.1.tgz", 1231 | "integrity": "sha1-98IAzRuS7yNrOZ7s9zxkjReqlNI=", 1232 | "dev": true, 1233 | "requires": { 1234 | "lodash._isnative": "~2.4.1", 1235 | "lodash.noop": "~2.4.1" 1236 | } 1237 | }, 1238 | "lodash._shimkeys": { 1239 | "version": "2.4.1", 1240 | "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", 1241 | "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", 1242 | "dev": true, 1243 | "requires": { 1244 | "lodash._objecttypes": "~2.4.1" 1245 | } 1246 | }, 1247 | "lodash._slice": { 1248 | "version": "2.4.1", 1249 | "resolved": "https://registry.npmjs.org/lodash._slice/-/lodash._slice-2.4.1.tgz", 1250 | "integrity": "sha1-dFz0GlNZexj2iImFREBe+isG2Q8=", 1251 | "dev": true 1252 | }, 1253 | "lodash.assign": { 1254 | "version": "4.2.0", 1255 | "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", 1256 | "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" 1257 | }, 1258 | "lodash.bind": { 1259 | "version": "2.4.1", 1260 | "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-2.4.1.tgz", 1261 | "integrity": "sha1-XRn6AFyMTSNvr0dCx7eh/Kvikmc=", 1262 | "dev": true, 1263 | "requires": { 1264 | "lodash._createwrapper": "~2.4.1", 1265 | "lodash._slice": "~2.4.1" 1266 | } 1267 | }, 1268 | "lodash.createcallback": { 1269 | "version": "2.4.4", 1270 | "resolved": "https://registry.npmjs.org/lodash.createcallback/-/lodash.createcallback-2.4.4.tgz", 1271 | "integrity": "sha1-SkUwhJsBZVAD/L31Y1JO/zzrAsQ=", 1272 | "dev": true, 1273 | "requires": { 1274 | "lodash._basecreatecallback": "~2.4.1", 1275 | "lodash._baseisequal": "~2.4.1", 1276 | "lodash.isobject": "~2.4.1", 1277 | "lodash.keys": "~2.4.1", 1278 | "lodash.property": "~2.4.1" 1279 | }, 1280 | "dependencies": { 1281 | "lodash.keys": { 1282 | "version": "2.4.1", 1283 | "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", 1284 | "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", 1285 | "dev": true, 1286 | "requires": { 1287 | "lodash._isnative": "~2.4.1", 1288 | "lodash._shimkeys": "~2.4.1", 1289 | "lodash.isobject": "~2.4.1" 1290 | } 1291 | } 1292 | } 1293 | }, 1294 | "lodash.forin": { 1295 | "version": "2.4.1", 1296 | "resolved": "https://registry.npmjs.org/lodash.forin/-/lodash.forin-2.4.1.tgz", 1297 | "integrity": "sha1-gInq7X0lsIZyt8Zv0HrFXQYjIOs=", 1298 | "dev": true, 1299 | "requires": { 1300 | "lodash._basecreatecallback": "~2.4.1", 1301 | "lodash._objecttypes": "~2.4.1" 1302 | } 1303 | }, 1304 | "lodash.get": { 1305 | "version": "4.4.2", 1306 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 1307 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" 1308 | }, 1309 | "lodash.identity": { 1310 | "version": "2.4.1", 1311 | "resolved": "https://registry.npmjs.org/lodash.identity/-/lodash.identity-2.4.1.tgz", 1312 | "integrity": "sha1-ZpTP+mX++TH3wxzobHRZfPVg9PE=", 1313 | "dev": true 1314 | }, 1315 | "lodash.isfunction": { 1316 | "version": "2.4.1", 1317 | "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-2.4.1.tgz", 1318 | "integrity": "sha1-LP1XXHPkmKtX4xm3f6Aq3vE6lNE=", 1319 | "dev": true 1320 | }, 1321 | "lodash.isobject": { 1322 | "version": "2.4.1", 1323 | "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", 1324 | "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", 1325 | "dev": true, 1326 | "requires": { 1327 | "lodash._objecttypes": "~2.4.1" 1328 | } 1329 | }, 1330 | "lodash.noop": { 1331 | "version": "2.4.1", 1332 | "resolved": "https://registry.npmjs.org/lodash.noop/-/lodash.noop-2.4.1.tgz", 1333 | "integrity": "sha1-T7VPgWZS5a4Q6PcvcXo4jHMmU4o=", 1334 | "dev": true 1335 | }, 1336 | "lodash.property": { 1337 | "version": "2.4.1", 1338 | "resolved": "https://registry.npmjs.org/lodash.property/-/lodash.property-2.4.1.tgz", 1339 | "integrity": "sha1-QEnAVJ2vWnECvF6T7q67N53rEy8=", 1340 | "dev": true 1341 | }, 1342 | "lodash.support": { 1343 | "version": "2.4.1", 1344 | "resolved": "https://registry.npmjs.org/lodash.support/-/lodash.support-2.4.1.tgz", 1345 | "integrity": "sha1-Mg4LZwMWc8KNeiu12eAzGkUkBRU=", 1346 | "dev": true, 1347 | "requires": { 1348 | "lodash._isnative": "~2.4.1" 1349 | } 1350 | }, 1351 | "lru-cache": { 1352 | "version": "2.7.3", 1353 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", 1354 | "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", 1355 | "dev": true 1356 | }, 1357 | "metalsmith": { 1358 | "version": "2.3.0", 1359 | "resolved": "https://registry.npmjs.org/metalsmith/-/metalsmith-2.3.0.tgz", 1360 | "integrity": "sha1-gzr7taKmOF4tmuPZNeOeM+rqUjE=", 1361 | "dev": true, 1362 | "requires": { 1363 | "absolute": "0.0.1", 1364 | "chalk": "^1.1.3", 1365 | "clone": "^1.0.2", 1366 | "co-fs-extra": "^1.2.1", 1367 | "commander": "^2.6.0", 1368 | "gray-matter": "^2.0.0", 1369 | "has-generators": "^1.0.1", 1370 | "is": "^3.1.0", 1371 | "is-utf8": "~0.2.0", 1372 | "recursive-readdir": "^2.1.0", 1373 | "rimraf": "^2.2.8", 1374 | "stat-mode": "^0.2.0", 1375 | "thunkify": "^2.1.2", 1376 | "unyield": "0.0.1", 1377 | "ware": "^1.2.0", 1378 | "win-fork": "^1.1.1" 1379 | } 1380 | }, 1381 | "metalsmith-templates": { 1382 | "version": "0.7.0", 1383 | "resolved": "https://registry.npmjs.org/metalsmith-templates/-/metalsmith-templates-0.7.0.tgz", 1384 | "integrity": "sha1-Ccjo1TxofCwidEzNlfmbUBy6ibo=", 1385 | "dev": true, 1386 | "requires": { 1387 | "async": "~0.2.10", 1388 | "consolidate": "~0.10.0", 1389 | "debug": "~0.7.4", 1390 | "extend": "~1.2.1", 1391 | "is-utf8": "^0.2.0", 1392 | "lodash.omit": "~2.4.1", 1393 | "multimatch": "^0.1.0" 1394 | }, 1395 | "dependencies": { 1396 | "async": { 1397 | "version": "0.2.10", 1398 | "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", 1399 | "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", 1400 | "dev": true 1401 | }, 1402 | "debug": { 1403 | "version": "0.7.4", 1404 | "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", 1405 | "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=", 1406 | "dev": true 1407 | }, 1408 | "lodash._basedifference": { 1409 | "version": "2.4.1", 1410 | "resolved": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-2.4.1.tgz", 1411 | "integrity": "sha1-eGl8pnQSyeW12+q1TRslc7iaYzQ=", 1412 | "dev": true, 1413 | "requires": { 1414 | "lodash._baseindexof": "~2.4.1", 1415 | "lodash._cacheindexof": "~2.4.1", 1416 | "lodash._createcache": "~2.4.1", 1417 | "lodash._largearraysize": "~2.4.1", 1418 | "lodash._releaseobject": "~2.4.1" 1419 | } 1420 | }, 1421 | "lodash._baseflatten": { 1422 | "version": "2.4.1", 1423 | "resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-2.4.1.tgz", 1424 | "integrity": "sha1-rrvn5tKMe1GwW9kusdyiexSYyNI=", 1425 | "dev": true, 1426 | "requires": { 1427 | "lodash.isarguments": "~2.4.1", 1428 | "lodash.isarray": "~2.4.1" 1429 | } 1430 | }, 1431 | "lodash._baseindexof": { 1432 | "version": "2.4.1", 1433 | "resolved": "https://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-2.4.1.tgz", 1434 | "integrity": "sha1-WdtYQStAYEykUxq696Q88cw2vVk=", 1435 | "dev": true 1436 | }, 1437 | "lodash._cacheindexof": { 1438 | "version": "2.4.1", 1439 | "resolved": "https://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-2.4.1.tgz", 1440 | "integrity": "sha1-qf0HzCeO64gqaxjQ/tbFXghzz0s=", 1441 | "dev": true, 1442 | "requires": { 1443 | "lodash._baseindexof": "~2.4.1", 1444 | "lodash._keyprefix": "~2.4.1" 1445 | } 1446 | }, 1447 | "lodash._createcache": { 1448 | "version": "2.4.1", 1449 | "resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-2.4.1.tgz", 1450 | "integrity": "sha1-9MIoLDvKGY0S9BhKwrYhLmkdyFQ=", 1451 | "dev": true, 1452 | "requires": { 1453 | "lodash._cachepush": "~2.4.1", 1454 | "lodash._getobject": "~2.4.1", 1455 | "lodash._releaseobject": "~2.4.1" 1456 | } 1457 | }, 1458 | "lodash.isarguments": { 1459 | "version": "2.4.1", 1460 | "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-2.4.1.tgz", 1461 | "integrity": "sha1-STGpwIJTrfCRrnyhkiWKlzh27Mo=", 1462 | "dev": true 1463 | }, 1464 | "lodash.isarray": { 1465 | "version": "2.4.1", 1466 | "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-2.4.1.tgz", 1467 | "integrity": "sha1-tSoybB9i9tfac6MdVAHfbvRPD6E=", 1468 | "dev": true, 1469 | "requires": { 1470 | "lodash._isnative": "~2.4.1" 1471 | } 1472 | }, 1473 | "lodash.omit": { 1474 | "version": "2.4.1", 1475 | "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-2.4.1.tgz", 1476 | "integrity": "sha1-isNsKE8eIDXb04QPos+kDgjeS5w=", 1477 | "dev": true, 1478 | "requires": { 1479 | "lodash._basedifference": "~2.4.1", 1480 | "lodash._baseflatten": "~2.4.1", 1481 | "lodash.createcallback": "~2.4.1", 1482 | "lodash.forin": "~2.4.1" 1483 | } 1484 | } 1485 | } 1486 | }, 1487 | "mimic-fn": { 1488 | "version": "1.2.0", 1489 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 1490 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", 1491 | "dev": true 1492 | }, 1493 | "minimatch": { 1494 | "version": "3.0.4", 1495 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 1496 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 1497 | "dev": true, 1498 | "requires": { 1499 | "brace-expansion": "^1.1.7" 1500 | } 1501 | }, 1502 | "minimist": { 1503 | "version": "0.0.8", 1504 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 1505 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 1506 | "dev": true 1507 | }, 1508 | "mkdirp": { 1509 | "version": "0.5.1", 1510 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 1511 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 1512 | "dev": true, 1513 | "requires": { 1514 | "minimist": "0.0.8" 1515 | } 1516 | }, 1517 | "mocha": { 1518 | "version": "5.2.0", 1519 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", 1520 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", 1521 | "dev": true, 1522 | "requires": { 1523 | "browser-stdout": "1.3.1", 1524 | "commander": "2.15.1", 1525 | "debug": "3.1.0", 1526 | "diff": "3.5.0", 1527 | "escape-string-regexp": "1.0.5", 1528 | "glob": "7.1.2", 1529 | "growl": "1.10.5", 1530 | "he": "1.1.1", 1531 | "minimatch": "3.0.4", 1532 | "mkdirp": "0.5.1", 1533 | "supports-color": "5.4.0" 1534 | }, 1535 | "dependencies": { 1536 | "commander": { 1537 | "version": "2.15.1", 1538 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", 1539 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", 1540 | "dev": true 1541 | }, 1542 | "debug": { 1543 | "version": "3.1.0", 1544 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 1545 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 1546 | "dev": true, 1547 | "requires": { 1548 | "ms": "2.0.0" 1549 | } 1550 | }, 1551 | "glob": { 1552 | "version": "7.1.2", 1553 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", 1554 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", 1555 | "dev": true, 1556 | "requires": { 1557 | "fs.realpath": "^1.0.0", 1558 | "inflight": "^1.0.4", 1559 | "inherits": "2", 1560 | "minimatch": "^3.0.4", 1561 | "once": "^1.3.0", 1562 | "path-is-absolute": "^1.0.0" 1563 | } 1564 | }, 1565 | "ms": { 1566 | "version": "2.0.0", 1567 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1568 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 1569 | "dev": true 1570 | }, 1571 | "supports-color": { 1572 | "version": "5.4.0", 1573 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", 1574 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", 1575 | "dev": true, 1576 | "requires": { 1577 | "has-flag": "^3.0.0" 1578 | } 1579 | } 1580 | } 1581 | }, 1582 | "ms": { 1583 | "version": "2.1.1", 1584 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1585 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 1586 | }, 1587 | "multimatch": { 1588 | "version": "0.1.0", 1589 | "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-0.1.0.tgz", 1590 | "integrity": "sha1-CZ2fj4RjrDbPv6JzYLwWzuh97WQ=", 1591 | "dev": true, 1592 | "requires": { 1593 | "lodash": "~2.4.1", 1594 | "minimatch": "~0.2.14" 1595 | }, 1596 | "dependencies": { 1597 | "lodash": { 1598 | "version": "2.4.2", 1599 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", 1600 | "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", 1601 | "dev": true 1602 | }, 1603 | "minimatch": { 1604 | "version": "0.2.14", 1605 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", 1606 | "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", 1607 | "dev": true, 1608 | "requires": { 1609 | "lru-cache": "2", 1610 | "sigmund": "~1.0.0" 1611 | } 1612 | } 1613 | } 1614 | }, 1615 | "mute-stream": { 1616 | "version": "0.0.7", 1617 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", 1618 | "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", 1619 | "dev": true 1620 | }, 1621 | "natural-compare": { 1622 | "version": "1.4.0", 1623 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1624 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", 1625 | "dev": true 1626 | }, 1627 | "nice-try": { 1628 | "version": "1.0.5", 1629 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 1630 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", 1631 | "dev": true 1632 | }, 1633 | "object-assign": { 1634 | "version": "4.1.1", 1635 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1636 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 1637 | "dev": true 1638 | }, 1639 | "once": { 1640 | "version": "1.4.0", 1641 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1642 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1643 | "dev": true, 1644 | "requires": { 1645 | "wrappy": "1" 1646 | } 1647 | }, 1648 | "onetime": { 1649 | "version": "2.0.1", 1650 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 1651 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", 1652 | "dev": true, 1653 | "requires": { 1654 | "mimic-fn": "^1.0.0" 1655 | } 1656 | }, 1657 | "optimist": { 1658 | "version": "0.6.1", 1659 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", 1660 | "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", 1661 | "dev": true, 1662 | "requires": { 1663 | "minimist": "~0.0.1", 1664 | "wordwrap": "~0.0.2" 1665 | } 1666 | }, 1667 | "optionator": { 1668 | "version": "0.8.2", 1669 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 1670 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 1671 | "dev": true, 1672 | "requires": { 1673 | "deep-is": "~0.1.3", 1674 | "fast-levenshtein": "~2.0.4", 1675 | "levn": "~0.3.0", 1676 | "prelude-ls": "~1.1.2", 1677 | "type-check": "~0.3.2", 1678 | "wordwrap": "~1.0.0" 1679 | }, 1680 | "dependencies": { 1681 | "wordwrap": { 1682 | "version": "1.0.0", 1683 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1684 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 1685 | "dev": true 1686 | } 1687 | } 1688 | }, 1689 | "os-tmpdir": { 1690 | "version": "1.0.2", 1691 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 1692 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", 1693 | "dev": true 1694 | }, 1695 | "parent-module": { 1696 | "version": "1.0.0", 1697 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", 1698 | "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", 1699 | "dev": true, 1700 | "requires": { 1701 | "callsites": "^3.0.0" 1702 | } 1703 | }, 1704 | "path-is-absolute": { 1705 | "version": "1.0.1", 1706 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1707 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1708 | "dev": true 1709 | }, 1710 | "path-is-inside": { 1711 | "version": "1.0.2", 1712 | "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", 1713 | "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", 1714 | "dev": true 1715 | }, 1716 | "path-key": { 1717 | "version": "2.0.1", 1718 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 1719 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", 1720 | "dev": true 1721 | }, 1722 | "pathval": { 1723 | "version": "1.1.0", 1724 | "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", 1725 | "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", 1726 | "dev": true 1727 | }, 1728 | "prelude-ls": { 1729 | "version": "1.1.2", 1730 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 1731 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 1732 | "dev": true 1733 | }, 1734 | "prettier": { 1735 | "version": "1.16.4", 1736 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", 1737 | "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==", 1738 | "dev": true 1739 | }, 1740 | "prettier-linter-helpers": { 1741 | "version": "1.0.0", 1742 | "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", 1743 | "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", 1744 | "dev": true, 1745 | "requires": { 1746 | "fast-diff": "^1.1.2" 1747 | } 1748 | }, 1749 | "progress": { 1750 | "version": "2.0.3", 1751 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 1752 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", 1753 | "dev": true 1754 | }, 1755 | "punycode": { 1756 | "version": "2.1.1", 1757 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 1758 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 1759 | }, 1760 | "recursive-readdir": { 1761 | "version": "2.2.2", 1762 | "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", 1763 | "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", 1764 | "dev": true, 1765 | "requires": { 1766 | "minimatch": "3.0.4" 1767 | } 1768 | }, 1769 | "regexpp": { 1770 | "version": "2.0.1", 1771 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", 1772 | "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", 1773 | "dev": true 1774 | }, 1775 | "resolve-from": { 1776 | "version": "4.0.0", 1777 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 1778 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 1779 | "dev": true 1780 | }, 1781 | "restore-cursor": { 1782 | "version": "2.0.0", 1783 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 1784 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", 1785 | "dev": true, 1786 | "requires": { 1787 | "onetime": "^2.0.0", 1788 | "signal-exit": "^3.0.2" 1789 | } 1790 | }, 1791 | "rimraf": { 1792 | "version": "2.6.3", 1793 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 1794 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 1795 | "dev": true, 1796 | "requires": { 1797 | "glob": "^7.1.3" 1798 | }, 1799 | "dependencies": { 1800 | "glob": { 1801 | "version": "7.1.3", 1802 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 1803 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 1804 | "dev": true, 1805 | "requires": { 1806 | "fs.realpath": "^1.0.0", 1807 | "inflight": "^1.0.4", 1808 | "inherits": "2", 1809 | "minimatch": "^3.0.4", 1810 | "once": "^1.3.0", 1811 | "path-is-absolute": "^1.0.0" 1812 | } 1813 | } 1814 | } 1815 | }, 1816 | "run-async": { 1817 | "version": "2.3.0", 1818 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", 1819 | "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", 1820 | "dev": true, 1821 | "requires": { 1822 | "is-promise": "^2.1.0" 1823 | } 1824 | }, 1825 | "rxjs": { 1826 | "version": "6.4.0", 1827 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", 1828 | "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", 1829 | "dev": true, 1830 | "requires": { 1831 | "tslib": "^1.9.0" 1832 | } 1833 | }, 1834 | "safer-buffer": { 1835 | "version": "2.1.2", 1836 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1837 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 1838 | "dev": true 1839 | }, 1840 | "semver": { 1841 | "version": "5.6.0", 1842 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", 1843 | "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", 1844 | "dev": true 1845 | }, 1846 | "shebang-command": { 1847 | "version": "1.2.0", 1848 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 1849 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 1850 | "dev": true, 1851 | "requires": { 1852 | "shebang-regex": "^1.0.0" 1853 | } 1854 | }, 1855 | "shebang-regex": { 1856 | "version": "1.0.0", 1857 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 1858 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", 1859 | "dev": true 1860 | }, 1861 | "sigmund": { 1862 | "version": "1.0.1", 1863 | "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", 1864 | "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", 1865 | "dev": true 1866 | }, 1867 | "signal-exit": { 1868 | "version": "3.0.2", 1869 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1870 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", 1871 | "dev": true 1872 | }, 1873 | "slice-ansi": { 1874 | "version": "2.1.0", 1875 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", 1876 | "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", 1877 | "dev": true, 1878 | "requires": { 1879 | "ansi-styles": "^3.2.0", 1880 | "astral-regex": "^1.0.0", 1881 | "is-fullwidth-code-point": "^2.0.0" 1882 | }, 1883 | "dependencies": { 1884 | "ansi-styles": { 1885 | "version": "3.2.1", 1886 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 1887 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 1888 | "dev": true, 1889 | "requires": { 1890 | "color-convert": "^1.9.0" 1891 | } 1892 | } 1893 | } 1894 | }, 1895 | "slug-component": { 1896 | "version": "1.1.0", 1897 | "resolved": "https://registry.npmjs.org/slug-component/-/slug-component-1.1.0.tgz", 1898 | "integrity": "sha1-IkKQoEWRv5rAi5xiLToU9D46Dfc=" 1899 | }, 1900 | "source-map": { 1901 | "version": "0.6.1", 1902 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 1903 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1904 | "dev": true 1905 | }, 1906 | "sprintf-js": { 1907 | "version": "1.0.3", 1908 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1909 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 1910 | "dev": true 1911 | }, 1912 | "stat-mode": { 1913 | "version": "0.2.2", 1914 | "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", 1915 | "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", 1916 | "dev": true 1917 | }, 1918 | "string-width": { 1919 | "version": "2.1.1", 1920 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 1921 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 1922 | "dev": true, 1923 | "requires": { 1924 | "is-fullwidth-code-point": "^2.0.0", 1925 | "strip-ansi": "^4.0.0" 1926 | }, 1927 | "dependencies": { 1928 | "ansi-regex": { 1929 | "version": "3.0.0", 1930 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 1931 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", 1932 | "dev": true 1933 | }, 1934 | "strip-ansi": { 1935 | "version": "4.0.0", 1936 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 1937 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 1938 | "dev": true, 1939 | "requires": { 1940 | "ansi-regex": "^3.0.0" 1941 | } 1942 | } 1943 | } 1944 | }, 1945 | "strip-ansi": { 1946 | "version": "3.0.1", 1947 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1948 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1949 | "dev": true, 1950 | "requires": { 1951 | "ansi-regex": "^2.0.0" 1952 | } 1953 | }, 1954 | "strip-json-comments": { 1955 | "version": "2.0.1", 1956 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1957 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", 1958 | "dev": true 1959 | }, 1960 | "supports-color": { 1961 | "version": "2.0.0", 1962 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 1963 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", 1964 | "dev": true 1965 | }, 1966 | "table": { 1967 | "version": "5.2.2", 1968 | "resolved": "https://registry.npmjs.org/table/-/table-5.2.2.tgz", 1969 | "integrity": "sha512-f8mJmuu9beQEDkKHLzOv4VxVYlU68NpdzjbGPl69i4Hx0sTopJuNxuzJd17iV2h24dAfa93u794OnDA5jqXvfQ==", 1970 | "dev": true, 1971 | "requires": { 1972 | "ajv": "^6.6.1", 1973 | "lodash": "^4.17.11", 1974 | "slice-ansi": "^2.0.0", 1975 | "string-width": "^2.1.1" 1976 | } 1977 | }, 1978 | "text-table": { 1979 | "version": "0.2.0", 1980 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1981 | "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", 1982 | "dev": true 1983 | }, 1984 | "through": { 1985 | "version": "2.3.8", 1986 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1987 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", 1988 | "dev": true 1989 | }, 1990 | "thunkify": { 1991 | "version": "2.1.2", 1992 | "resolved": "https://registry.npmjs.org/thunkify/-/thunkify-2.1.2.tgz", 1993 | "integrity": "sha1-+qDp0jDFGsyVyhOjYawFyn4EVT0=", 1994 | "dev": true 1995 | }, 1996 | "thunkify-wrap": { 1997 | "version": "1.0.4", 1998 | "resolved": "https://registry.npmjs.org/thunkify-wrap/-/thunkify-wrap-1.0.4.tgz", 1999 | "integrity": "sha1-tSvlSN3+/aIOALWMYJZ2K0PdaIA=", 2000 | "dev": true, 2001 | "requires": { 2002 | "enable": "1" 2003 | } 2004 | }, 2005 | "tmp": { 2006 | "version": "0.0.33", 2007 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 2008 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 2009 | "dev": true, 2010 | "requires": { 2011 | "os-tmpdir": "~1.0.2" 2012 | } 2013 | }, 2014 | "toml": { 2015 | "version": "2.3.6", 2016 | "resolved": "https://registry.npmjs.org/toml/-/toml-2.3.6.tgz", 2017 | "integrity": "sha512-gVweAectJU3ebq//Ferr2JUY4WKSDe5N+z0FvjDncLGyHmIDoxgY/2Ie4qfEIDm4IS7OA6Rmdm7pdEEdMcV/xQ==", 2018 | "dev": true 2019 | }, 2020 | "topo": { 2021 | "version": "3.0.3", 2022 | "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", 2023 | "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==", 2024 | "requires": { 2025 | "hoek": "6.x.x" 2026 | } 2027 | }, 2028 | "tslib": { 2029 | "version": "1.9.3", 2030 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", 2031 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", 2032 | "dev": true 2033 | }, 2034 | "type-check": { 2035 | "version": "0.3.2", 2036 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 2037 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 2038 | "dev": true, 2039 | "requires": { 2040 | "prelude-ls": "~1.1.2" 2041 | } 2042 | }, 2043 | "type-detect": { 2044 | "version": "4.0.8", 2045 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 2046 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", 2047 | "dev": true 2048 | }, 2049 | "uglify-js": { 2050 | "version": "3.4.9", 2051 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", 2052 | "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", 2053 | "dev": true, 2054 | "optional": true, 2055 | "requires": { 2056 | "commander": "~2.17.1", 2057 | "source-map": "~0.6.1" 2058 | } 2059 | }, 2060 | "universalify": { 2061 | "version": "0.1.2", 2062 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", 2063 | "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" 2064 | }, 2065 | "unyield": { 2066 | "version": "0.0.1", 2067 | "resolved": "https://registry.npmjs.org/unyield/-/unyield-0.0.1.tgz", 2068 | "integrity": "sha1-FQ5l2kK/d0JEW5WKZOubhdHSsYA=", 2069 | "dev": true, 2070 | "requires": { 2071 | "co": "~3.1.0" 2072 | } 2073 | }, 2074 | "uri-js": { 2075 | "version": "4.2.2", 2076 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 2077 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 2078 | "dev": true, 2079 | "requires": { 2080 | "punycode": "^2.1.0" 2081 | } 2082 | }, 2083 | "ware": { 2084 | "version": "1.3.0", 2085 | "resolved": "https://registry.npmjs.org/ware/-/ware-1.3.0.tgz", 2086 | "integrity": "sha1-0bFPOdLiy0q4xAmPdW/ksWTkc9Q=", 2087 | "dev": true, 2088 | "requires": { 2089 | "wrap-fn": "^0.1.0" 2090 | } 2091 | }, 2092 | "which": { 2093 | "version": "1.3.1", 2094 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 2095 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 2096 | "dev": true, 2097 | "requires": { 2098 | "isexe": "^2.0.0" 2099 | } 2100 | }, 2101 | "win-fork": { 2102 | "version": "1.1.1", 2103 | "resolved": "https://registry.npmjs.org/win-fork/-/win-fork-1.1.1.tgz", 2104 | "integrity": "sha1-j1jgZW/KAK3IyGoriePNLWotXl4=", 2105 | "dev": true 2106 | }, 2107 | "wordwrap": { 2108 | "version": "0.0.3", 2109 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", 2110 | "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", 2111 | "dev": true 2112 | }, 2113 | "wrap-fn": { 2114 | "version": "0.1.5", 2115 | "resolved": "https://registry.npmjs.org/wrap-fn/-/wrap-fn-0.1.5.tgz", 2116 | "integrity": "sha1-8htuQQFv9KfjFyDbxjoJAWvfmEU=", 2117 | "dev": true, 2118 | "requires": { 2119 | "co": "3.1.0" 2120 | } 2121 | }, 2122 | "wrappy": { 2123 | "version": "1.0.2", 2124 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 2125 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 2126 | "dev": true 2127 | }, 2128 | "write": { 2129 | "version": "0.2.1", 2130 | "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", 2131 | "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", 2132 | "dev": true, 2133 | "requires": { 2134 | "mkdirp": "^0.5.1" 2135 | } 2136 | } 2137 | } 2138 | } 2139 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "metalsmith-json-to-files", 3 | "version": "2.0.0", 4 | "description": "A metalsmith plugin to generate files from JSON", 5 | "main": "lib/index.js", 6 | "scripts": { 7 | "lint": "eslint --cache --fix .", 8 | "test": "mocha", 9 | "posttest": "npm run lint", 10 | "dev-test": "nodemon --exec 'npm test'", 11 | "version": "npm test", 12 | "postversion": "git push && git push --tags && npm publish" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/woodyrew/metalsmith-json-to-files.git" 17 | }, 18 | "keywords": [ 19 | "metalsmith", 20 | "static-site", 21 | "json", 22 | "generator", 23 | "files" 24 | ], 25 | "author": "Woody Goodricke ", 26 | "license": "GPL-2.0", 27 | "bugs": { 28 | "url": "https://github.com/woodyrew/metalsmith-json-to-files/issues" 29 | }, 30 | "homepage": "https://github.com/woodyrew/metalsmith-json-to-files#readme", 31 | "dependencies": { 32 | "async": "^2.6.1", 33 | "debug": "^4.1.1", 34 | "joi": "^14.3.1", 35 | "jsonfile": "^5.0.0", 36 | "lodash.assign": "^4.2.0", 37 | "lodash.get": "^4.4.2", 38 | "slug-component": "^1.1.0" 39 | }, 40 | "devDependencies": { 41 | "assert-dir-equal": "^1.1.0", 42 | "chai": "^4.2.0", 43 | "eslint": "^5.13.0", 44 | "eslint-config-prettier": "^4.0.0", 45 | "eslint-plugin-prettier": "^3.0.1", 46 | "handlebars": "^4.0.12", 47 | "metalsmith": "^2.3.0", 48 | "metalsmith-templates": "^0.7.0", 49 | "mocha": "^5.2.0", 50 | "prettier": "^1.16.4" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test/fixtures/basic/expected/default.html: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /test/fixtures/basic/src/default.html: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /test/fixtures/file_generation/expected/basic/success.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woodyrew/metalsmith-json-to-files/d471454cb5c68dbaa44846affc322826b5b0697c/test/fixtures/file_generation/expected/basic/success.html -------------------------------------------------------------------------------- /test/fixtures/file_generation/expected/default.html: -------------------------------------------------------------------------------- 1 | Take a look... 2 | -------------------------------------------------------------------------------- /test/fixtures/file_generation/src/default.html: -------------------------------------------------------------------------------- 1 | --- 2 | name: My Posts 3 | json_files: 4 | source_file: basic 5 | filename_pattern: basic/:data.filename 6 | --- 7 | Take a look... 8 | -------------------------------------------------------------------------------- /test/fixtures/file_generation_permalinks/expected/basic/success/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woodyrew/metalsmith-json-to-files/d471454cb5c68dbaa44846affc322826b5b0697c/test/fixtures/file_generation_permalinks/expected/basic/success/index.html -------------------------------------------------------------------------------- /test/fixtures/file_generation_permalinks/expected/default.html: -------------------------------------------------------------------------------- 1 | Take a look... 2 | -------------------------------------------------------------------------------- /test/fixtures/file_generation_permalinks/src/default.html: -------------------------------------------------------------------------------- 1 | --- 2 | name: My Posts 3 | json_files: 4 | source_file: basic 5 | filename_pattern: basic/:data.filename 6 | as_permalink: true 7 | --- 8 | Take a look... 9 | -------------------------------------------------------------------------------- /test/fixtures/hbs_templates/expected/default.html: -------------------------------------------------------------------------------- 1 | # My Posts 2 | 3 | Take a look... 4 | 5 | -------------------------------------------------------------------------------- /test/fixtures/hbs_templates/expected/post/success.html: -------------------------------------------------------------------------------- 1 | # Test Success 2 | 3 | JSON === Winning 4 | -------------------------------------------------------------------------------- /test/fixtures/hbs_templates/src/default.html: -------------------------------------------------------------------------------- 1 | --- 2 | name: My Posts 3 | json_files: 4 | source_file: basic 5 | filename_pattern: post/:data.filename 6 | template: post.hbs 7 | template: posts.hbs 8 | --- 9 | Take a look... 10 | -------------------------------------------------------------------------------- /test/fixtures/hbs_templates/templates/post.hbs: -------------------------------------------------------------------------------- 1 | # {{data.name}} 2 | 3 | {{{data.contents}}} 4 | -------------------------------------------------------------------------------- /test/fixtures/hbs_templates/templates/posts.hbs: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | {{{contents}}} 4 | -------------------------------------------------------------------------------- /test/fixtures/json/basic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "filename": "success", 4 | "name": "Test Success", 5 | "contents": "JSON === Winning" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict'; 4 | 5 | var expect = require('chai').expect; 6 | var equal = require('assert-dir-equal'); 7 | var Metalsmith = require('metalsmith'); 8 | var templates = require('metalsmith-templates'); 9 | var json_to_files = require('../lib'); 10 | 11 | describe('metalsmith-json-to-files basic', function() { 12 | var test_path = 'test/fixtures/basic'; 13 | 14 | it('should fail without source_path', function(done) { 15 | new Metalsmith(test_path).use(json_to_files()).build(function(err) { 16 | expect(err).to.be.an('error'); 17 | done(); 18 | }); 19 | }); 20 | 21 | it('should do standard file copying', function(done) { 22 | new Metalsmith(test_path) 23 | .use( 24 | json_to_files({ 25 | source_path: '../json/' 26 | }) 27 | ) 28 | .build(function(err) { 29 | if (err) { 30 | return done(err); 31 | } 32 | 33 | equal(test_path + '/expected', test_path + '/build'); 34 | done(); 35 | }); 36 | }); 37 | }); 38 | 39 | describe('metalsmith-json-to-files file generation', function() { 40 | var test_path = 'test/fixtures/file_generation'; 41 | 42 | it('should do basic file generation', function(done) { 43 | new Metalsmith(test_path) 44 | .use( 45 | json_to_files({ 46 | source_path: '../json/' 47 | }) 48 | ) 49 | .build(function(err) { 50 | if (err) { 51 | return done(err); 52 | } 53 | 54 | equal(test_path + '/expected', test_path + '/build'); 55 | done(); 56 | }); 57 | }); 58 | }); 59 | 60 | describe('metalsmith-json-to-files file generation with permalinks', function() { 61 | var test_path = 'test/fixtures/file_generation_permalinks'; 62 | 63 | it('should do basic file generation', function(done) { 64 | new Metalsmith(test_path) 65 | .use( 66 | json_to_files({ 67 | source_path: '../json/' 68 | }) 69 | ) 70 | .build(function(err) { 71 | if (err) { 72 | return done(err); 73 | } 74 | 75 | equal(test_path + '/expected', test_path + '/build'); 76 | done(); 77 | }); 78 | }); 79 | }); 80 | 81 | describe('metalsmith-json-to-files file generation with templates', function() { 82 | var test_path = 'test/fixtures/hbs_templates'; 83 | 84 | it('should do basic file generation', function(done) { 85 | new Metalsmith(test_path) 86 | .use( 87 | json_to_files({ 88 | source_path: '../json/' 89 | }) 90 | ) 91 | .use( 92 | templates({ 93 | engine: 'handlebars', 94 | directory: 'templates' 95 | }) 96 | ) 97 | .build(function(err) { 98 | if (err) { 99 | return done(err); 100 | } 101 | 102 | equal(test_path + '/expected', test_path + '/build'); 103 | done(); 104 | }); 105 | }); 106 | }); 107 | 108 | describe('metalsmith-json-to-files Tests', function() { 109 | it('should handle missing json file'); 110 | it('should handle filename not being able to be generated'); 111 | it('should create permalinks'); 112 | it('should work with (handlebars) templates'); 113 | }); 114 | --------------------------------------------------------------------------------