Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/config

Package Overview
Dependencies
Maintainers
2
Versions
320
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/config - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

2

lib/index.d.ts

@@ -8,3 +8,3 @@ export declare const types: any;

};
}) => any;
}) => Promise<any>;
export default _default;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -7,2 +15,8 @@ const camelcase = require("camelcase");

const path = require("path");
const whichcb = require("which");
function which(cmd) {
return new Promise((resolve, reject) => {
whichcb(cmd, (err, resolvedPath) => err ? reject(err) : resolve(resolvedPath));
});
}
exports.types = Object.assign({

@@ -36,6 +50,18 @@ 'background': Boolean,

}, npmTypes.types);
exports.default = (opts) => {
exports.default = (opts) => __awaiter(this, void 0, void 0, function* () {
const packageManager = opts && opts.packageManager || { name: 'pnpm', version: 'undefined' };
const cliArgs = opts && opts.cliArgs || {};
// This is what npm does as well, overriding process.execPath with the resolved location of Node.
// The value of process.execPath is changed only for the duration of config initialization.
// Otherwise, npmConfig.globalPrefix would sometimes have the bad location.
const originalExecPath = process.execPath;
try {
const node = yield which(process.argv[0]);
if (node.toUpperCase() !== process.execPath.toUpperCase()) {
process.execPath = node;
}
}
catch (err) { } // tslint:disable-line:no-empty
const npmConfig = loadNpmConf();
process.execPath = originalExecPath;
if (!cliArgs['user-agent']) {

@@ -78,3 +104,3 @@ cliArgs['user-agent'] = `${packageManager.name}/${packageManager.version} npm/? node/${process.version} ${process.platform} ${process.arch}`;

return pnpmConfig;
};
});
//# sourceMappingURL=index.js.map
{
"name": "@pnpm/config",
"version": "0.1.1",
"version": "0.2.0",
"description": "Gets configs for pnpm",

@@ -36,4 +36,6 @@ "main": "lib/index.js",

"@types/node": "^9.4.6",
"@types/which": "^1.3.1",
"camelcase": "^4.1.0",
"npm-conf": "^1.1.3"
"npm-conf": "^1.1.3",
"which": "^1.3.0"
},

@@ -40,0 +42,0 @@ "devDependencies": {

@@ -20,3 +20,3 @@ # @pnpm/config

const pnpmConfigs = getConfigs()
getConfigs().then(pnpmConfigs => console.log(pnpmConfigs))
```

@@ -23,0 +23,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc