UNPKG

disassemble-package

Version:

Separate the config contained in package.json into a file.

10 lines 409 B
import { writeFile } from 'fs/promises'; import { join } from 'path'; const template = (json) => `module.exports = ${json}`; export const disassembleHusky = async (path, json, { space }) => { if (json.hasOwnProperty('husky')) { await writeFile(join(path, '.huskyrc.js'), template(JSON.stringify(json.husky, undefined, space))); delete json.husky; } }; //# sourceMappingURL=husky.js.map