UNPKG

waka-pm

Version:

a pnpm supplement for enforcing consistent versions across all workspaces

35 lines 1.65 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.writeWakaPackageDocument = exports.writeWakaRootDocument = exports.writePackageJson = exports.writeWakaPackage = exports.writeWakaRoot = void 0; const yaml_1 = __importDefault(require("yaml")); const fs_1 = __importDefault(require("fs")); // const yamlDumpOpts = { sortKeys: true }; async function writeWakaRoot(rootFile, root) { fs_1.default.writeFileSync(rootFile, yaml_1.default.stringify(root)); return Promise.resolve(rootFile); } exports.writeWakaRoot = writeWakaRoot; async function writeWakaPackage(packageFile, pkg) { fs_1.default.writeFileSync(packageFile, yaml_1.default.stringify(pkg)); return Promise.resolve(packageFile); } exports.writeWakaPackage = writeWakaPackage; async function writePackageJson(packageJsonFile, packageJsonContents) { fs_1.default.writeFileSync(packageJsonFile, JSON.stringify(packageJsonContents, null, 2)); return Promise.resolve(packageJsonFile); } exports.writePackageJson = writePackageJson; async function writeWakaRootDocument(rootFile, root) { fs_1.default.writeFileSync(rootFile, root.toString()); return Promise.resolve(rootFile); } exports.writeWakaRootDocument = writeWakaRootDocument; async function writeWakaPackageDocument(packageFile, pkg) { fs_1.default.writeFileSync(packageFile, pkg.toString()); return Promise.resolve(packageFile); } exports.writeWakaPackageDocument = writeWakaPackageDocument; //# sourceMappingURL=write.js.map