pnpm
Version:
A fast implementation of npm install
37 lines • 1.15 kB
JavaScript
;
const path = require('path');
const constantDefaults_1 = require('./constantDefaults');
const env_1 = require('../env');
const defaults = () => ({
fetchRetries: 2,
fetchRetryFactor: 10,
fetchRetryMintimeout: 1e4,
fetchRetryMaxtimeout: 6e4,
storePath: getDefaultStorePath(),
globalPath: constantDefaults_1.GlobalPath,
logger: 'pretty',
ignoreScripts: false,
linkLocal: false,
strictSsl: true,
tag: 'latest',
production: process.env.NODE_ENV === 'production',
cwd: process.cwd(),
force: false,
silent: true,
depth: 0,
cacheTTL: 60 * 60 * 24,
flatTree: false,
});
function getDefaultStorePath() {
if (env_1.preserveSymlinks)
return path.join(constantDefaults_1.GlobalPath, '.store');
return 'node_modules/.store';
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (opts = {}) => {
if (opts.flatTree === true && !env_1.preserveSymlinks) {
throw new TypeError('Flat tree is supported only on Node.js >= 6.3.0');
}
return Object.assign({}, defaults(), opts);
};
//# sourceMappingURL=extendOptions.js.map