UNPKG

linky-cli

Version:

A CLI tool to retrieve your Linky power consumption

9 lines (7 loc) 238 B
const fs = require('fs'); const getDirName = require('path').dirname; const mkdirp = require('mkdirp'); module.exports = async (data, path) => { await mkdirp(getDirName(path)); fs.writeFileSync(path, JSON.stringify(data, null, 2)); };