@tinkoff/package-manager-wrapper
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -1,3 +0,1 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { command } from 'execa'; | ||
@@ -13,5 +11,7 @@ | ||
async exists(options) { | ||
const { name, cwd } = options; | ||
const { name } = options; | ||
try { | ||
await fs.promises.access(path.join(cwd || this.rootDir, 'node_modules', name, 'package.json')); | ||
// for tramvai repository and potentially for other monorepos, | ||
// we can check package availability with Node.js resolve algorithm | ||
require.resolve(name); | ||
return true; | ||
@@ -18,0 +18,0 @@ } |
@@ -5,11 +5,4 @@ 'use strict'; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var execa = require('execa'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); | ||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path); | ||
class PackageManager { | ||
@@ -23,5 +16,7 @@ constructor(options) { | ||
async exists(options) { | ||
const { name, cwd } = options; | ||
const { name } = options; | ||
try { | ||
await fs__default["default"].promises.access(path__default["default"].join(cwd || this.rootDir, 'node_modules', name, 'package.json')); | ||
// for tramvai repository and potentially for other monorepos, | ||
// we can check package availability with Node.js resolve algorithm | ||
require.resolve(name); | ||
return true; | ||
@@ -28,0 +23,0 @@ } |
{ | ||
"name": "@tinkoff/package-manager-wrapper", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
15553
408