UNPKG

pnpm

Version:

A fast implementation of npm install

23 lines 691 B
"use strict"; const path = require('path'); const fs = require('fs'); const pnpmPkgJson_1 = require('../pnpmPkgJson'); function read(storePath) { const storeJsonPath = path.join(storePath, 'store.json'); try { return JSON.parse(fs.readFileSync(storeJsonPath, 'utf8')); } catch (err) { return { pnpm: pnpmPkgJson_1.default.version, packages: {} }; } } exports.read = read; function save(storePath, storeJson) { const storeJsonPath = path.join(storePath, 'store.json'); fs.writeFileSync(storeJsonPath, JSON.stringify(storeJson, null, 2), 'utf8'); } exports.save = save; //# sourceMappingURL=storeJsonController.js.map