You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					19 lines
				
				375 B
			
		
		
			
		
	
	
					19 lines
				
				375 B
			| 
								 
											3 years ago
										 
									 | 
							
								'use strict'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const fs = require('graceful-fs')
							 | 
						||
| 
								 | 
							
								const path = require('path')
							 | 
						||
| 
								 | 
							
								const mkdir = require('../mkdirs')
							 | 
						||
| 
								 | 
							
								const jsonFile = require('./jsonfile')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function outputJsonSync (file, data, options) {
							 | 
						||
| 
								 | 
							
								  const dir = path.dirname(file)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  if (!fs.existsSync(dir)) {
							 | 
						||
| 
								 | 
							
								    mkdir.mkdirsSync(dir)
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  jsonFile.writeJsonSync(file, data, options)
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports = outputJsonSync
							 |