Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const _ = require('lodash')
- const yaml = require('js-yaml')
- const fs = require('fs');
- const dotPaths = [...]
- const cfg = {}
- _.each(dotPaths, function(path) {
- _.set(cfg, path, path)
- });
- fs.writeFile('mongod.conf', yaml.safeDump(cfg), (err) => {
- if (err) throw err;
- console.log('mongod.conf saved.')
- });
Add Comment
Please, Sign In to add comment