Socket
Socket
Sign inDemoInstall

resolve-from

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-from - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

14

index.js
'use strict';
const path = require('path');
const Module = require('module');
const fs = require('fs');

@@ -14,3 +15,14 @@ const resolveFrom = (fromDir, moduleId, silent) => {

fromDir = path.resolve(fromDir);
try {
fromDir = fs.realpathSync(fromDir);
} catch (err) {
if (err.code === 'ENOENT') {
fromDir = path.resolve(fromDir);
} else if (silent) {
return null;
} else {
throw err;
}
}
const fromFile = path.join(fromDir, 'noop.js');

@@ -17,0 +29,0 @@

65

package.json
{
"name": "resolve-from",
"version": "3.0.0",
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
"license": "MIT",
"repository": "sindresorhus/resolve-from",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"require",
"resolve",
"path",
"module",
"from",
"like",
"import",
"path"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "resolve-from",
"version": "4.0.0",
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
"license": "MIT",
"repository": "sindresorhus/resolve-from",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"require",
"resolve",
"path",
"module",
"from",
"like",
"import"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

@@ -9,3 +9,3 @@ # resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from)

```
$ npm install --save resolve-from
$ npm install resolve-from
```

@@ -64,6 +64,7 @@

- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
- [req-from](https://github.com/sindresorhus/req-from) - Require a module from a given path
- [req-cwd](https://github.com/sindresorhus/req-cwd) - Require a module from the current working directory
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
- [lazy-req](https://github.com/sindresorhus/lazy-req) - Require modules lazily
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module

@@ -70,0 +71,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