Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
375 bytes
|
Line | |
---|
1 | 'use strict'
|
---|
2 |
|
---|
3 | const fs = require('graceful-fs')
|
---|
4 | const path = require('path')
|
---|
5 | const mkdir = require('../mkdirs')
|
---|
6 | const jsonFile = require('./jsonfile')
|
---|
7 |
|
---|
8 | function outputJsonSync (file, data, options) {
|
---|
9 | const dir = path.dirname(file)
|
---|
10 |
|
---|
11 | if (!fs.existsSync(dir)) {
|
---|
12 | mkdir.mkdirsSync(dir)
|
---|
13 | }
|
---|
14 |
|
---|
15 | jsonFile.writeJsonSync(file, data, options)
|
---|
16 | }
|
---|
17 |
|
---|
18 | module.exports = outputJsonSync
|
---|
Note:
See
TracBrowser
for help on using the repository browser.