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

@yarn-tool/resolve-package

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarn-tool/resolve-package - npm Package Compare versions

Comparing version 1.0.35 to 1.0.36

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.0.36](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.35...@yarn-tool/resolve-package@1.0.36) (2021-11-03)
### 📦 Code Refactoring
* avoid https://github.com/ezolenko/rollup-plugin-typescript2/issues/286 ([627d0cc](https://github.com/bluelovers/ws-yarn-workspaces/commit/627d0cc2a183a6be43a9d05c1ae6da3d8edd5e2e))
## [1.0.35](https://github.com/bluelovers/ws-yarn-workspaces/compare/@yarn-tool/resolve-package@1.0.34...@yarn-tool/resolve-package@1.0.35) (2021-09-15)

@@ -8,0 +19,0 @@

import type { IPackageJson } from '@ts-type/package-dts';
export declare function resolvePackage(name: string, options?: {
/**
* @see RequireResolve
*/
paths?: string[];

@@ -8,3 +11,6 @@ }): {

pkg: IPackageJson<any>;
pkgConfigLocation: string;
entryPointLocation: string;
resolveLocation(path: string, ...paths: string[]): string;
};
export default resolvePackage;

12

index.js

@@ -5,8 +5,16 @@ "use strict";

const upath2_1 = require("upath2");
const pkg_dir_1 = require("pkg-dir");
function resolvePackage(name, options) {
let pkgRoot = (0, upath2_1.dirname)(require.resolve(`${name}/package.json`, options));
const entryPointLocation = require.resolve(name, options);
const pkgRoot = (0, pkg_dir_1.sync)(entryPointLocation);
const pkgConfigLocation = (0, upath2_1.resolve)(pkgRoot, 'package.json');
return {
name,
pkgRoot,
pkg: require(`${pkgRoot}/package.json`),
pkg: require(pkgConfigLocation),
pkgConfigLocation,
entryPointLocation,
resolveLocation(path, ...paths) {
return (0, upath2_1.resolve)(pkgRoot, path, ...paths);
},
};

@@ -13,0 +21,0 @@ }

{
"name": "@yarn-tool/resolve-package",
"version": "1.0.35",
"description": "",
"version": "1.0.36",
"description": "resolve package root and package.json paths",
"keywords": [
"resolve",
"package",
"json",
"root",
"npm",
"entry",
"find",
"up",
"find-up",
"findup",
"look-up",
"look",
"file",
"search",
"match",
"parent",
"parents",
"folder",
"directory",
"walk",
"walking",
"path"
],
"homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/resolve-package#readme",

@@ -33,2 +57,3 @@ "bugs": {

"@ts-type/package-dts": "^1.0.51",
"pkg-dir": "< 6 >= 5",
"tslib": "^2.3.1",

@@ -40,3 +65,3 @@ "upath2": "^3.1.10"

},
"gitHead": "b1b0c39dafdf127bc25233ad34c44ab6fc0da40b"
"gitHead": "dbf64ed0b8593237aee787074124264e2138ba7e"
}

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