Socket
Socket
Sign inDemoInstall

@pnpm/link-bins

Package Overview
Dependencies
Maintainers
3
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/link-bins - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

1

lib/index.d.ts
import { DependencyManifest } from '@pnpm/types';
declare const _default: (modules: string, binPath: string, opts: {
allowExoticManifests?: boolean | undefined;
warn: (msg: string) => void;

@@ -4,0 +5,0 @@ }) => Promise<void>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const package_bins_1 = require("@pnpm/package-bins");
const read_importer_manifest_1 = require("@pnpm/read-importer-manifest");
const read_package_json_1 = require("@pnpm/read-package-json");

@@ -20,6 +21,7 @@ const cmdShim = require("@zkochan/cmd-shim");

const pkgDirs = await getPkgDirs_1.default(modules, opts.warn);
const pkgBinOpts = Object.assign({ allowExoticManifests: false }, opts);
const allCmds = R.unnest((await Promise.all(pkgDirs
.filter((dir) => !isSubdir(dir, binPath)) // Don't link own bins
.map(normalizePath)
.map((target) => getPackageBins(target, opts.warn))))
.map((target) => getPackageBins(target, pkgBinOpts))))
.filter((cmds) => cmds.length));

@@ -53,6 +55,6 @@ return linkBins(allCmds, binPath, opts);

}
async function getPackageBins(target, warn) {
const pkg = await safeReadPkg(target);
async function getPackageBins(target, opts) {
const pkg = opts.allowExoticManifests ? await safeReadImporterManifestOnly(target) : await safeReadPkg(target);
if (!pkg) {
warn(`There's a directory in node_modules without package.json: ${target}`);
opts.warn(`There's a directory in node_modules without package.json: ${target}`);
return [];

@@ -92,2 +94,13 @@ }

}
async function safeReadImporterManifestOnly(importerDir) {
try {
return await read_importer_manifest_1.readImporterManifestOnly(importerDir);
}
catch (err) {
if (err.code === 'ENOENT') {
return null;
}
throw err;
}
}
//# sourceMappingURL=index.js.map

4

package.json
{
"name": "@pnpm/link-bins",
"version": "4.1.0",
"version": "4.2.0",
"description": "Link bins to node_modules/.bin",

@@ -37,2 +37,3 @@ "main": "lib/index.js",

"@pnpm/package-bins": "^3.1.0",
"@pnpm/read-importer-manifest": "^1.0.0",
"@pnpm/read-package-json": "^2.0.0",

@@ -57,3 +58,2 @@ "@pnpm/types": "^3.0.0",

"@types/tape": "^4.2.31",
"@types/tempy": "^0.3.0",
"mos": "^2.0.0-alpha.3",

@@ -60,0 +60,0 @@ "mos-plugin-readme": "^1.0.4",

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